Class: VR::TreeView
- Inherits:
-
Gtk::TreeView
- Object
- Gtk::TreeView
- VR::TreeView
- Includes:
- ViewCommon
- Defined in:
- lib/treeview/TreeView.rb
Overview
All the methods in VR::ViewCommon work on VR::TreeViews and VR::ListViews.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from ViewCommon
#column_keys, #vr_cols, #vr_renderer
Instance Method Summary collapse
- #add_row(parent, hash = {}) ⇒ Object
-
#initialize(cols) ⇒ TreeView
constructor
See VR::ListView constructor.
Methods included from ViewCommon
#col_attr, #column, #delete_selected, #each_renderer, #each_row, #flatten_hash, #get_iter, #id, #load_columns, #method_missing, #ren_attr, #renderer, #selected_rows, #turn_on_comboboxes, #vr_row
Constructor Details
#initialize(cols) ⇒ TreeView
See VR::ListView constructor. (exactly the same)
17 18 19 20 21 |
# File 'lib/treeview/TreeView.rb', line 17 def initialize(cols) super() self.model = Gtk::TreeStore.new(*flatten_hash(cols).values) load_columns(cols) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class VR::ViewCommon
Instance Method Details
#add_row(parent, hash = {}) ⇒ Object
35 36 37 38 39 |
# File 'lib/treeview/TreeView.rb', line 35 def add_row(parent, hash = {}) row = vr_row(model.append(parent)) hash.each_pair { |key, val| row[key] = val } return row end |