Displaying 2 results from an estimated 2 matches for "get_descendants".
2006 Dec 30
0
[812] trunk/wxsugar/lib/wx_sugar/wx_classes/window.rb: Added find_window and descendants methods
...n class="lines">@@ -1,5 +1,26 @@
</span><span class="cx"> # extensions to Wx::Window
</span><span class="cx"> class Wx::Window
</span><ins>+  # Returns an array containing this window and all windows descended
+  # from it.
+  def get_descendants
+    get_children.inject([ self ]) do | desc, child |
+      desc + child.get_descendants
+    end
+  end
+
+  # Passed a block, returns the first window within self''s window
+  # hierarchy for which the block evaluates to true. A class name may
+  # optionally be passed to restrict the se...
2007 Apr 02
0
[939] trunk/wxsugar/lib/wx_sugar/wx_classes/window.rb: Add has_style? method, allow find_window to work even if C++ method
...pan class="cx">   #  a_frame.find_window(Wx::StaticText) { | tx | tx.label =~ /foo/ }
</span><span class="cx">   def find_window(a_class = Wx::Window, &block)
</span><del>-    descendants.grep(a_class).detect(&block)
</del><ins>+    get_descendants.grep(a_class).detect(&block)
</ins><span class="cx">   end
</span><span class="cx"> 
</span><span class="cx">   # Returns the window''s current size as a two element array
</span><span class="lines">...