Class: Gtk::TreeStore
Constant Summary collapse
- TYPE_MAP =
{ Integer => 24, # GObject::TYPE_INT, String => 64 # GObject::TYPE_STRING }
Instance Attribute Summary
Attributes inherited from GObject
Class Method Summary collapse
Instance Method Summary collapse
- #append(parent = nil) ⇒ Object
-
#initialize(*types) ⇒ TreeStore
constructor
A new instance of TreeStore.
- #set_column_types(*types) ⇒ Object
Methods inherited from GObject
#method_missing, #signal_connect, type_register, #unref
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Gtk::GObject
Class Method Details
.type_mapped_types(*types) ⇒ Object
16 17 18 19 |
# File 'lib/gtk/tree_store.rb', line 16 def self.type_mapped_types(*types) types = types.first if types.size == 1 && types.first.is_a?(Array) types.map{ |type| TYPE_MAP[type] } end |
Instance Method Details
#append(parent = nil) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/gtk/tree_store.rb', line 37 def append parent=nil iter = Gtk::TreeIter.new Gtk::Lib.gtk_tree_store_append(native,iter,parent) iter.owner = self iter end |
#set_column_types(*types) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/gtk/tree_store.rb', line 30 def set_column_types *types types = self.class.type_mapped_types(*types) array = FFI::MemoryPointer.new(:long,types.size) array.write_array_of_long(types) Lib.gtk_tree_store_set_column_types(@native,types.size,array) end |