FXTreeList-App crashes

My FX-Application crashes, when I update an FXTreeItem-Icon in an
FXTreeList (setopenIcon / setClosedIcon) with an event-method
(right-mouse-click).
Does anybody have an idea ?

On Thu, 22 Feb 2007 13:15:13 +0100, Jörg Abelshauser
[email protected] wrote:

My FX-Application crashes, when I update an FXTreeItem-Icon in an
FXTreeList (setopenIcon / setClosedIcon) with an event-method
(right-mouse-click).
Does anybody have an idea ?

Run it with regular ruby.exe instead of rubyw.exe (if on Windows) to get
some details about the crash?

David V.

David V. wrote:

On Thu, 22 Feb 2007 13:15:13 +0100, Jörg Abelshauser
[email protected] wrote:

My FX-Application crashes, when I update an FXTreeItem-Icon in an
FXTreeList (setopenIcon / setClosedIcon) with an event-method
(right-mouse-click).
Does anybody have an idea ?

Run it with regular ruby.exe instead of rubyw.exe (if on Windows) to get
some details about the crash?

David V.

not really helpful:
FxGui.rb:547: [BUG] Segmentation fault
ruby 1.8.2 (2004-12-25) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application’s support team for more information.

Further, here is the code-snippet, which is called when
right-mouse-click at an tree-item:

item = @tree.getFirstItem

if @toggle != 8
    @tree.setItemText(item, "Bla")
    icon = makeIcon("testnode.ico")
    @tree.setItemClosedIcon(item, icon)
    @toggle = 8
else
    @tree.setItemText(item, "Boing")
    icon = makeIcon("testnode.ico")
    @tree.setItemClosedIcon(item, icon)
    @toggle = 7
end

regards Jörg

…has helped ! Thanks a lot!
but it’s not obvious from the docs. Whats’s the difference between the
constructor and the create-method, the 1st icon , which i commit to the
item doesn’t need the create-method ???

regards Joerg

On 2/22/07 7:25 AM, in article
[email protected], “Jörg Abelshauser”
[email protected] wrote:

else
    @tree.setItemText(item, "Boing")
    icon = makeIcon("testnode.ico")
    @tree.setItemClosedIcon(item, icon)
    @toggle = 7
end

You need to call create() on the icon after you construct it, e.g.

icon = makeIcon("testnode.ico")
icon.create
@tree.setItemClosedIcon(item, icon)

Hope this helps,

Lyle

When you initially create the application, all children of the app are
created automatically.
If you add any new children after the initial App.create and you attempt
to access/display them, they have to be created, which you have to do
manually. I made this mistake before too.

Raj

On 2/23/07 2:47 AM, in article
[email protected], “Jörg Abelshauser”
[email protected] wrote:

…has helped ! Thanks a lot!

but it’s not obvious from the docs. Whats’s the difference between the
constructor and the create-method, the 1st icon , which i commit to the
item doesn’t need the create-method ???

This question is answered in the FAQ:

http://www.fox-toolkit.org/faq.html#ILLEGALICON

Hope this helps,

Lyle