[fxruby-users] test if a window has been destroyed

Lyle Johnson lyle.johnson at gmail.com
Thu Apr 19 14:18:01 EDT 2007

On 4/19/07, Meinrad Recheis <meinrad.recheis at gmail.com> wrote:

> jeah, and interestingly a widget comes back to life when you call create
> again. i found out that calling destroy on widgets does not remove them from
> the widget tree and they come back to live after calling create on their
> parent. but this is another story.

Yes, this is as designed. Calling destroy() on a widget is (supposed
to) only destroy the server-side resource and leave the client-side
object (i.e. the Ruby instance) intact -- so that you could, as you
noted, call create() on it to "re-realize" it. This is in contrast to,
say, removeWidget(), which both destroys the server-side resource and
deletes the client-side object.

The message that Joel is seeing indicates that the underlying C++
object has been destroyed (deleted) as well, which shouldn't happen if
all you're doing is calling destroy on it. So I need to figure out
what's going on there.

> Lyle, I also think that such a state that can be queried with a method like
> destroyed? would be very good to have. i had to work around this shortcoming
> in fxruby for several times. Is it technically possible?

As I stated in a previous e-mail, created? is supposed to answer true
is there is a server-side resource (e.g. a widget, font, cursor, ...)
associated with the client-side object (the Ruby instance).

More information about the fxruby-users mailing list