Preventing destruction

Hi,

Is there a way to flag a widget to stop the destruction process
when the parents are being destroyed.

Or is there any way to have a callback BEFORE the widget is
marked for destruction in order to remove it from the widget
hierarchy to avoid it from being destroyed ?

Thanks.

In the widgets unrealize callback (the one that you don’t want to have destroyed), set Pt_DESTROYED to Pt_FALSE. Pt_DESTROYED is
a part of the Pt_ARG_FLAGS resource. After you hae done this, reparent the widget. You will have to re-realize the widget after
it has been reparented.

Rod



Previously, jhroyer wrote in qdn.public.qnxrtp.photon:

Hi,

Is there a way to flag a widget to stop the destruction process
when the parents are being destroyed.

Or is there any way to have a callback BEFORE the widget is
marked for destruction in order to remove it from the widget
hierarchy to avoid it from being destroyed ?

Thanks.

Nope it doesn’t work because Pt_DESTROYED is a read-only flag as shown
in the documentation.

Regards.

“Rodney Dowdall” <rdowdall@qnx.com> wrote in message
news:Voyager.010123144319.4022293A@rdowdall…

In the widgets unrealize callback (the one that you don’t want to have
destroyed), set Pt_DESTROYED to Pt_FALSE. Pt_DESTROYED is
a part of the Pt_ARG_FLAGS resource. After you hae done this, reparent
the widget. You will have to re-realize the widget after
it has been reparented.

Hey Jean-Hugues:

Did you actually try it? I was looking at the code and it looks like we may actually allow you to set this flag. Try it if you haven’t already and if it works then I’ll ask to have the docs updated. If it doesn’t work then I probably missed something. I’ll see if I can come up with another way.

Rod



Previously, Jean-Hugues Royer wrote in qdn.public.qnxrtp.photon:

Nope it doesn’t work because Pt_DESTROYED is a read-only flag as shown
in the documentation.

Regards.

“Rodney Dowdall” <> rdowdall@qnx.com> > wrote in message
news:Voyager.010123144319.4022293A@rdowdall…


In the widgets unrealize callback (the one that you don’t want to have
destroyed), set Pt_DESTROYED to Pt_FALSE. Pt_DESTROYED is
a part of the Pt_ARG_FLAGS resource. After you hae done this, reparent
the widget. You will have to re-realize the widget after
it has been reparented.

\

I have to make a correction. I’m sorry if I have mislead anyone in to thinking that this is actually a GOOD way of doing things. The problem lies in the fact that the PtReparentWidget call doesn’t reset this flag. This will be fixed and at this time the process that I described three messages ago is just a work around. In general you should not play with the Pt_DESTROYED flag at all but for the time being it is possible (again only do it if you REALLY, REALLY have to) to do so. The docs don’t have to be updated but rather this is a bug with the Pt_DESTROYED flag.

Rod

Previously, Rodney Dowdall wrote in qdn.public.qnxrtp.photon:

Hey Jean-Hugues:

Did you actually try it? I was looking at the code and it looks like we may actually allow you to set this flag. Try it if you haven’t already and if it works then I’ll ask to have the docs updated. If it doesn’t work then I probably missed something. I’ll see if I can come up with another way.

Rod



Previously, Jean-Hugues Royer wrote in qdn.public.qnxrtp.photon:
Nope it doesn’t work because Pt_DESTROYED is a read-only flag as shown
in the documentation.

Regards.

“Rodney Dowdall” <> rdowdall@qnx.com> > wrote in message
news:Voyager.010123144319.4022293A@rdowdall…


In the widgets unrealize callback (the one that you don’t want to have
destroyed), set Pt_DESTROYED to Pt_FALSE. Pt_DESTROYED is
a part of the Pt_ARG_FLAGS resource. After you hae done this, reparent
the widget. You will have to re-realize the widget after
it has been reparented.



\