[fxruby-users] FXFoldingList & FXFoldingItem missing iterators
Philippe Lang
philippe.lang at attiksystem.ch
Sat Dec 2 03:26:59 EST 2006
Hi,
I have noticed the FXFoldingList and FXFoldingItem classes do not have the same "each" iterator as their FXTree... counterpart, making them not 100% compatible.
Here is something for file iterators.rb, for the next release of FXRuby.
-------------
class FXFoldingList
include Enumerable
#
# Calls block once for each root-level folding list item, passing a
# reference to that item as a parameter.
#
def each # :yields: aFoldingItem
current = firstItem
while current != nil
yield current
current = current.next
end
self
end
end
class FXFoldingItem
include Enumerable
#
# Calls block once for each child of this folding list item, passing a
# reference to that child item as a parameter.
#
def each # :yields: aFoldingItem
current = first
while current != nil
yield current
current = current.next
end
self
end
end
-----------------
Cheers,
---------------
Philippe Lang
Attik System
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3125 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20061202/58f80441/attachment.bin
More information about the fxruby-users
mailing list