Forum: Ruby Re: fxRuby: changing icon in TreeItem crashes

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C5bf12f85379833300a26fba924bfb08?d=identicon&s=25 Kloubakov Yura (Guest)
on 2006-04-07 10:16
(Received via mailing list)
Christer,

You have to explicitly call "create" for the new icon to
create the server side object.  Fox does it automatically
for all the objects it can see at the time "create" is
called for the FXApp object if I remember correctly.

>     begin
>
> ...
>
>   doc = makeIcon("minidoc.png")

    doc.create

>   @tree.currentItem.text = "new icon coming ..."
>   @tree.currentItem.closedIcon = doc   # crash!
>
> I had no problem adding icons when the TreeItem was constructed.
>
> I'm using fox14.
>
> Christer

Yura.
Af95bdaf87958c40150b813e94381bfd?d=identicon&s=25 Christer Nilsson (christer)
on 2006-04-07 16:02
Thanks Yura, this solved my problem!

Do I have to destroy or delete also, to balance create?

Christer

Kloubakov Yura wrote:
> Christer,
>
> You have to explicitly call "create" for the new icon to
> create the server side object.  Fox does it automatically
> for all the objects it can see at the time "create" is
> called for the FXApp object if I remember correctly.
>
>>     begin
>>
>> ...
>>
>>   doc = makeIcon("minidoc.png")
>
>     doc.create
>
>>   @tree.currentItem.text = "new icon coming ..."
>>   @tree.currentItem.closedIcon = doc   # crash!
>>
>> I had no problem adding icons when the TreeItem was constructed.
>>
>> I'm using fox14.
>>
>> Christer
>
> Yura.
0276239ca57aee241d4b41379587fa20?d=identicon&s=25 Lyle Johnson (Guest)
on 2006-04-07 16:09
(Received via mailing list)
On 4/7/06, Christer Nilsson <janchrister.nilsson@gmail.com> wrote:

> Do I have to destroy or delete also, to balance create?

No, the icon's resources will be destroyed automatically when it's
garbage-collected.
This topic is locked and can not be replied to.