Displaying 11 results from an estimated 11 matches for "get_first_child".
2007 Sep 07
0
[ wxruby-Bugs-13734 ] Problem with TreeCtrl#get_first_child and #get_next_child on MSW
...an respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=13734&group_id=35
Category: Incorrect behavior
Group: None
Status: Open
Resolution: None
Priority: 4
Submitted By: Alex Fenton (brokentoy)
Assigned to: Alex Fenton (brokentoy)
Summary: Problem with TreeCtrl#get_first_child and #get_next_child on MSW
Initial Comment:
On Windows, the "cookie" value does not seem to be getting returned correctly when looping over children in TreeCtrl. It is always returned as 0 - this can be seen in the treectrl.rb sample.
This also causes assertion failures in debug mode....
2006 Aug 18
10
TreeCtrl update
...ploading the
whole files instead of the diffs.
traverse_tree(tree_ctrl,tree_ctrl.get_root_item) do |node_id,cookie|
puts "Name: #{tree_ctrl.get_item_text(node_id)}\t\tCookie:
#{cookie}"
end
def traverse_tree(tree_ctrl,root_node,cookie=0,&block)
if cookie == 0
ret = tree_ctrl.get_first_child(root_node)
else
ret = tree_ctrl.get_next_child(root_node,cookie)
end
if ret[0].is_ok
if block_given?
yield(ret[0],ret[1])
end
traverse_tree(tree_ctrl,ret[0],0,&block)
end
ret_sib = tree_ctrl.get_next_sibling(root_node)
if ret_sib.is_ok
if block_given?...
2007 Jan 08
0
[842] trunk/wxsugar/lib/wx_sugar/wx_classes/treectrl.rb: Fix for TreeItemIds as Integers
...(rev 842)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx"> block.call(start_item)
</span><span class="cx"> if has_children(start_item)
</span><span class="cx"> child, cookie = get_first_child(start_item)
</span><del>- while child.is_ok
</del><ins>+ while child.nonzero?
</ins><span class="cx"> traverse(child, &block)
</span><span class="cx"> child = get_next_sibling(child)
</span><s...
2007 Oct 23
6
wxRuby 1.9.2
...to create a custom
Wx::App subclass, you can run an app like this:
Wx::App.run do
f = Frame.new(nil, :title => ''WxRuby demo'')
f.show
end
This will create an App, show a Window and start the main loop, all in
four lines of code.
== INCOMPATIBLE API CHANGES ==
TreeCtrl#get_first_child now only returns a single value, the tree id of
the relevant first child. Use #get_next_sibling to loop over a group of
child tree nodes, or use the convenience method #get_children.
== KNOWN ISSUES ==
At a late stage a minor regression has shown up. Some methods which may
return a Wx::Window...
2006 Dec 21
0
[793] trunk/wxsugar/lib/wx_sugar/wx_classes/treectrl.rb: Moved traverse method in wxSugar
...e, get_item_text).
+ #
+ # If +start_item+ is not specified, this method will recurse over
+ # every item within the tree, starting with the root item.
+ def traverse(start_item = self.get_root_item, &block)
+ block.call(start_item)
+ if has_children(start_item)
+ child, cookie = get_first_child(start_item)
+ while child.is_ok
+ traverse(child, &block)
+ child = get_next_sibling(child)
+ end
+ end
+ end
+end
</ins></span></pre>
</div>
</div>
</body>
</html>
2006 Dec 23
0
[797] trunk/wxruby2/swig/classes/TreeCtrl.i: Traverse method moved to wxSugar
...t;/span><span class="cx">         //This behavior matches that used by wxPython and wxPerl.
</span><span class="cx">         VALUE get_first_child(const wxTreeItemId& item)
</span></span></pre>
</div>
</div>
</body>
</html>
2007 Apr 02
0
[940] trunk/wxsugar/lib/wx_sugar/wx_classes/treectrl.rb: Align #traverse usage with #each in enumerable_controls.rb
...art_item),
+ get_item_data(start_item))
+ else
+ raise ArgumentError, "Invalid number of block parameters"
+ end
+
</ins><span class="cx"> if has_children(start_item)
</span><span class="cx"> child, cookie = get_first_child(start_item)
</span><span class="cx"> while child.nonzero?
</span></span></pre>
</div>
</div>
</body>
</html>
2007 Oct 17
19
1.9.2, OpenGL
[third sending attempt...]
I''m going to try and test out the samples on MSW over the next few days
and if things look good I think we should release 1.9.2. Might try and
fix the bugs related to TreeCtrl#get_first_child as these might involve
minor API changes. So if anyone has any time to test out SVN HEAD and
look for anything funny, please do.
Also, we have an anonymous patch submitted to implement GL Canvas. The
patch looks OK but doesn''t include a sample, and I haven''t had a chance
to t...
2006 Dec 05
0
[779] trunk/wxruby2: Added TreeCtrl#traverse method and documentation
...t;/span><span class="cx">         //This behavior matches that used by wxPython and wxPerl.
</span><span class="cx">         VALUE get_first_child(const wxTreeItemId& item)
</span></span></pre>
</div>
</div>
</body>
</html>
2007 Apr 14
0
[965] branches/wxruby2/wxwidgets_282/doc/textile: Misc.
...t;> to make these functions reentrant (i.e. allow more than one
</span><span class="cx"> enumeration on one and the same object simultaneously). The cookie passed to
</span><del>-GetFirstChild and GetNextChild should be the same variable.
</del><ins>+get_first_child and "get_next_child":treectrl.html#TreeCtrl_getnextchild should be the same variable.
</ins><span class="cx">
</span><del>-Returns an invalid tree item (i.e. IsOk() returns @false@) if there are no further children.
</del><ins>+Returns an inv...
2006 Dec 26
0
[806] trunk/wxruby2/samples/treectrl: Restored demonstration of use of icons and fonts within TreeCtrl
...and GTK, and only if
+ # Wx::TR_HAS_VARIABLE_ROW_HEIGHT style was used in the constructor
+ font = get_font
+ font.set_style(Wx::FONTSTYLE_ITALIC)
+ set_item_font(root_id, font)
</ins><span class="cx">
</span><span class="cx"> id,cookie = get_first_child(root_id)
</span><span class="cx"> set_item_text_colour(id, Wx::BLUE)
</span><span class="lines">@@ -1121,11 +1100,11 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class=&q...