Class: Gtk::TreeIter
Overview
The Gtk::TreeIter class is reopened and some auxiliary methods are added.
Instance Method Summary collapse
-
#content ⇒ Object
Returns the content of this node.
-
#content=(value) ⇒ Object
Sets the content of this node to value.
-
#each ⇒ Object
Traverse each of this Gtk::TreeIter instance’s children and yield to them.
-
#recursive_each {|_self| ... } ⇒ Object
Recursively traverse all nodes of this Gtk::TreeIter’s subtree (including self) and yield to them.
-
#remove_subtree(model) ⇒ Object
Remove the subtree of this Gtk::TreeIter instance from the model model.
-
#type ⇒ Object
Returns the type of this node.
-
#type=(value) ⇒ Object
Sets the type of this node to value.
Instance Method Details
#content ⇒ Object
Returns the content of this node.
194 195 196 |
# File 'lib/json/editor.rb', line 194 def content self[CONTENT_COL] end |
#content=(value) ⇒ Object
Sets the content of this node to value.
199 200 201 |
# File 'lib/json/editor.rb', line 199 def content=(value) self[CONTENT_COL] = value end |
#each ⇒ Object
Traverse each of this Gtk::TreeIter instance’s children and yield to them.
160 161 162 |
# File 'lib/json/editor.rb', line 160 def each n_children.times { |i| yield nth_child(i) } end |
#recursive_each {|_self| ... } ⇒ Object
Recursively traverse all nodes of this Gtk::TreeIter’s subtree (including self) and yield to them.
166 167 168 169 170 171 |
# File 'lib/json/editor.rb', line 166 def recursive_each(&block) yield self each do |i| i.recursive_each(&block) end end |
#remove_subtree(model) ⇒ Object
Remove the subtree of this Gtk::TreeIter instance from the model model.
175 176 177 178 179 |
# File 'lib/json/editor.rb', line 175 def remove_subtree(model) while current = first_child model.remove(current) end end |
#type ⇒ Object
Returns the type of this node.
182 183 184 |
# File 'lib/json/editor.rb', line 182 def type self[TYPE_COL] end |
#type=(value) ⇒ Object
Sets the type of this node to value. This implies setting the respective icon accordingly.
188 189 190 191 |
# File 'lib/json/editor.rb', line 188 def type=(value) self[TYPE_COL] = value self[ICON_COL] = Editor.fetch_icon(value) end |