Class: Gtk::TreeView
Instance Attribute Summary
Attributes inherited from GObject
Instance Method Summary collapse
- #get_cursor ⇒ Object
- #get_selection ⇒ Object
-
#initialize(model = nil) ⇒ TreeView
constructor
A new instance of TreeView.
Methods inherited from Widget
Methods inherited from GObject
#method_missing, #signal_connect, type_register, #unref
Constructor Details
#initialize(model = nil) ⇒ TreeView
Returns a new instance of TreeView.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gtk/tree_view.rb', line 10 def initialize(model=nil) @native = if model if model.is_a?(FFI::Pointer) model else Lib.gtk_tree_view_new_with_model(model.native) end else Lib.gtk_tree_view_new() end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gtk::GObject
Instance Method Details
#get_cursor ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/gtk/tree_view.rb', line 24 def get_cursor path = FFI::MemoryPointer.new :pointer column = FFI::MemoryPointer.new :pointer Lib.gtk_tree_view_get_cursor(native,path,column) path = path.get_pointer(0) column = column.get_pointer(0) [TreePath.new(path),TreeViewColumn.new(column)] end |
#get_selection ⇒ Object
21 22 23 |
# File 'lib/gtk/tree_view.rb', line 21 def get_selection TreeSelection.new(Lib.gtk_tree_view_get_selection(native)) end |