From: Jason Persampieri Date: 2002-12-17T10:09:51+09:00 Subject: Re: More FXRuby oddness : subclassed FXTreeItem Ahhh... always one step ahead of me, aren't ya? Here's a test case require 'fox' include Fox class MyTreeItem < FXTreeItem end class MyMainWindow < FXMainWindow def initialize(app) super(app, "Era - The Kush Build System", nil, nil, DECOR_ALL, 0, 0, 200, 200) tree = FXTreeList.new(self, 0, nil, 0, LAYOUT_FILL_X|LAYOUT_FILL_Y) tree.addItemLast(nil, MyTreeItem.new("NewItem")) tree.connect(SEL_COMMAND) {|sender, sel, item| puts item.class.to_s} end end theApp = FXApp.new theApp.init(ARGV) myWindow = MyMainWindow.new(theApp) theApp.create myWindow.show(PLACEMENT_SCREEN) theApp.run --- Lyle Johnson wrote: > Jason Persampieri wrote: > > > I have subclassed FXTreeItem (MyTreeItem) and > built a > > tree out of it. That works fine. > > > > However, when 'connecting' a SEL_COMMAND sent to > the > > tree to a method, the item that is sent is an > > FXTreeItem, and not a MyTreeItem. Is this the > > intended behaviour? > > No, you should get a reference to the original > MyTreeItem object(s). > This *sounds* like a bug that has already been fixed > for the (pending) > FXRuby-1.0.17 release; if you want to send me a test > case to > double-check, I'd be glad to confirm that it's doing > the right thing > before the official 1.0.17 release. > >