[Fxruby-users] bug: descending FXTreeItem causes coredump?
Status: Inactive
Brought to you by:
lyle
|
From: Kevin B. <kev...@sy...> - 2003-09-29 19:28:21
|
To All,
I'm having a problem with using descedants of FXTreeItem. Whatever is
causing the problem is hosing FXTreeList::removeItem.
Environment:
ruby 1.8.0 (2003-09-29) [i686-linux] (though I've used several 1.8
versions)
fox 1.0.46
FXRuby 1.0.26
Source that causes the bug is at the end of this message.
The problem appears in FXTreeList::removeItem, whenever a child item has
focus:
// Deleted current item
if(currentitem && item==olditem){
if(hasFocus()){
currentitem->setFocus(TRUE);
}
if((options&SELECT_MASK)==TREELIST_BROWSESELECT &&
currentitem->isEnabled()){
selectItem(currentitem,notify);
}
}
currentItem->setFocus ends up calling an already destroyed object or
something. I traced which pointers were being freed, and it looked
okay, so I'm not sure what's going on. I'm guessing that memory is
getting trashed.
Any help on this would be appreciated. I'm trying to get a
ruby/fox/FXRuby app completed very quickly. My workaround right now is
to change the focus to another control in onCmdQuit.
Kevin
-------------------------
require 'fox'
include Fox
class MyTreeItem < FXTreeItem
end
class MyMainWindow < FXMainWindow
def initialize(app)
super(app, 'Bug', nil, nil, DECOR_ALL, 0, 0, 600, 400)
tree = FXTreeList.new(self, 0, nil, 0,
TREELIST_NORMAL|TREELIST_SHOWS_LINES|TREELIST_SHOWS_BOXES|TREELIST_ROOT_BOXES|LAYOUT_FILL_X|LAYOUT_FILL_Y)
item = tree.addItemLast(@tree, MyTreeItem.new('Select and close -
just fine'))
item = tree.addItemLast(item, MyTreeItem.new('Select and close -
choke'))
end
def create
super
show(PLACEMENT_SCREEN)
end
end
app = FXApp.new('bug', 'bugtest')
MyMainWindow.new(app)
app.create
app.run
|