Philippe Lang
2006-Dec-02 08:26 UTC
[fxruby-users] FXFoldingList & FXFoldingItem missing iterators
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
Lyle Johnson
2006-Dec-05 13:43 UTC
[fxruby-users] FXFoldingList & FXFoldingItem missing iterators
On Dec 2, 2006, at 2:26 AM, Philippe Lang wrote:> 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.<snip> Thanks, Philippe!