Class: Gtk::TreeIter
- Includes:
- Enumerable
- Defined in:
- lib/vendor/json_pure/lib/json/editor.rb
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.
Methods included from Enumerable
Instance Method Details
#content ⇒ Object
Returns the content of this node.
195 196 197 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 195 def content self[CONTENT_COL] end |
#content=(value) ⇒ Object
Sets the content of this node to value.
200 201 202 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 200 def content=(value) self[CONTENT_COL] = value end |
#each ⇒ Object
Traverse each of this Gtk::TreeIter instance’s children and yield to them.
161 162 163 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 161 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.
167 168 169 170 171 172 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 167 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.
176 177 178 179 180 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 176 def remove_subtree(model) while current = first_child model.remove(current) end end |
#type ⇒ Object
Returns the type of this node.
183 184 185 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 183 def type self[TYPE_COL] end |
#type=(value) ⇒ Object
Sets the type of this node to value. This implies setting the respective icon accordingly.
189 190 191 192 |
# File 'lib/vendor/json_pure/lib/json/editor.rb', line 189 def type=(value) self[TYPE_COL] = value self[ICON_COL] = Editor.fetch_icon(value) end |