Class: Gtk::ListStore

Inherits:
GObject show all
Defined in:
lib/gtk/list_store.rb

Instance Attribute Summary

Attributes inherited from GObject

#native, #type

Instance Method Summary collapse

Methods inherited from GObject

#method_missing, #signal_connect, type_register, #unref

Constructor Details

#initialize(n_columns, *types) ⇒ ListStore

Returns a new instance of ListStore.



9
10
11
12
13
# File 'lib/gtk/list_store.rb', line 9

def initialize(n_columns, *types)
  @native = Lib.gtk_list_store_new(n_columns,
    *(types.map{ |type| [:int,GType[type]] }.flatten)
  )
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Gtk::GObject

Instance Method Details

#append(iter) ⇒ Object



14
15
16
17
# File 'lib/gtk/list_store.rb', line 14

def append iter
  iter.owner = self
  Lib.gtk_list_store_append(native,iter.to_ptr)
end

#to_tree_modelObject

def set *args

puts "SET #{args.inspect}"

end



21
22
23
# File 'lib/gtk/list_store.rb', line 21

def to_tree_model
  Gtk::TreeModel.new(native)
end