is_immortal / PtImmortalizeWidget()

Hi.

Do you have any idea when this PtImortalizeWidget() with its is_immortal
PtWidget_t member,
will work ?

Regards.

Hey Jean-Hugues

Judging from this and other postings, you are really concerned with your widgets beeing destroyed. Do you mind if I ask you what you are trying to do? It’s just that a person can run in to problems using these functions. The functions that you mention below already work. The widget will be unrealized but it will stay in memory. This is why it is recommended that you don’t use it.

Thanks
Rodnye


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

Hi.

Do you have any idea when this PtImortalizeWidget() with its is_immortal
PtWidget_t member,
will work ?

Regards.

Jean-Hugues Royer <jhroyer@joher.com> wrote:

Do you have any idea when this PtImortalizeWidget() with its is_immortal
PtWidget_t member,
will work ?

Funny thing, I posted a reply last night but it doesn’t seem to have
made it. Anyway, it went more or less like this:

AFAIK, it works right now. But it’s an undocumented, internal
function, and perhaps its purpose is not what you think it is. What
do you expect this function to do?

:wink:


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Hi good to see you back :slight_smile:

My understanding is that function prevent the widget from being destroyed
if his parent is.

in other word it’s being unparented,unrealized but not destroyed.

but unfortunately it doesn’t seem to be it ?



Previously, Wojtek Lerch wrote in qdn.public.qnxrtp.photon:

Funny thing, I posted a reply last night but it doesn’t seem to have
made it. Anyway, it went more or less like this:

AFAIK, it works right now. But it’s an undocumented, internal
function, and perhaps its purpose is not what you think it is. What
do you expect this function to do?

jhroyer <nospam28@joher.com> wrote:

My understanding is that function prevent the widget from being destroyed
if his parent is.

Sorry, wrong. The purpose of this function is to make sure that if the
widget gets destroyed, its dead body will hang around for a while to let
us take a look at it and perhaps just check whether it’s dead or not.

The idea is that you call PtImmortalizeWidget(), then run some code that
may try to destroy your widget, and then call PtMortalizeWidget(); and
if something has called PtDestroyWidget() while the widget was
“immortal”, the widget will not be freed or even removed from the
hierarchy at least until the PtMortalizeWidget() call. But the
assumption is that widgets get immortalized ony temporarily – the
function that called PtImmortalizeWidget() must call PtMortalizeWidget()
before returning.

BTW Even though I have explained these functions here, they are still
undocumented. My explanation is not a promise that they will exist or
behave similarly in the next version of Photon.

in other word it’s being unparented,unrealized but not destroyed.

You can “unparent” a widget. Only a disjoint widget can have no parent.

but unfortunately it doesn’t seem to be it ?

Sorry…


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

Thanks for the explanation,

Now do you know a way to prevent a widget from being destroyed
when its parent is being destroyed?

“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:951b9g$lrl$1@nntp.qnx.com

Sorry…