Class: VR::TreeView

Inherits:
Gtk::TreeView
  • Object
show all
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

FileTreeView

Constant Summary collapse

TREEVIEW_GTYPE =
self.name.split(":").collect {|x| x.empty? ? nil : x}.compact.join("_")

Instance Method Summary collapse

Methods included from ViewCommon

#col_attr, #column, #each_renderer, #each_row, #flatten_hash, #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)



21
22
23
24
25
# File 'lib/treeview/TreeView.rb', line 21

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



36
37
38
39
40
# File 'lib/treeview/TreeView.rb', line 36

def add_row(parent, hash)
	child = model.append(parent)
	(0..args.size-1).each { |i| child[i] = args[i] }
	return child
end