Sha256: b6767706a6410ad70aaaa85cb322bcd48e023259d123b46129037933965ee821

Contents?: true

Size: 468 Bytes

Versions: 5

Compression:

Stored size: 468 Bytes

Contents

# Hierarchical control with items
class Wx::TreeCtrl
  # Make these ruby enumerables so find, find_all, map etc are available
  include Enumerable
  # Iterate over all items
  alias :each :traverse

  # Return the children of +parent+ as an array of TreeItemIDs.
  def get_children(parent)
    kids = [ get_first_child(parent) ]
    return [] if kids[0].zero?

    while kid = get_next_sibling(kids.last) and not kid.zero?
      kids << kid
    end
    kids
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wxruby-1.9.2-powerpc-darwin8.10.0 lib/wx/classes/treectrl.rb
wxruby-1.9.2-i686-linux lib/wx/classes/treectrl.rb
wxruby-1.9.2-i686-darwin8.8.2 lib/wx/classes/treectrl.rb
wxruby-1.9.2-i386-mswin32 lib/wx/classes/treectrl.rb
wxruby-1.9.2-x86_64-linux lib/wx/classes/treectrl.rb