PtMessage Doc Problem !

This is for you guys at QNX,

I was recently debugging a function based on the source for PtAskQuestion
that was supplied with Photon 1.13 and earlier. After upgrading to Photon
1.14, it seems that my function was SIGSEGVing.

The problem was that the function was creating a PtMessage widget, then
waiting (in modal mode) for the user to select one of the buttons, then
destroying the PtMessage widget.

As it turns out, after 3 hours of searching!!! i realized that the PtMessage
widget is probably destroying iteself automatically when the user selects
one of it’s button. Am I right ? Can someone confirm this ?

If this is the case then this behaviour is NOT documented and it really
should be because it’s contrary to the normal behaviour of a widget where
the creator keeps control of the destruction…

I know that often, developper don’t read the doc quite enough before asking
questions but really, you should know that many developpers do read the doc
more than once and rely on it’s acuracy and completeness…

Anyway, why should I bother, since I have a feeling you stopped upgrading
Photon under QNX4 … ;-(

marclupien@hotmail.com

Marc Lupien <marclupien@hotmail.com> wrote:
: As it turns out, after 3 hours of searching!!! i realized that the PtMessage
: widget is probably destroying iteself automatically when the user selects
: one of it’s button. Am I right ? Can someone confirm this ?

I confirmed it with one of the developers. PtMessage is destroyed
automatically when you close it.

: If this is the case then this behaviour is NOT documented and it really
: should be because it’s contrary to the normal behaviour of a widget where
: the creator keeps control of the destruction…

The rationale is that, since it’s unrealized automatically, you might forget
to destroy it yourself, resulting in memory leaks.

: I know that often, developper don’t read the doc quite enough before asking
: questions but really, you should know that many developpers do read the doc
: more than once and rely on it’s acuracy and completeness…

I assure you that we try to make the docs complete and correct (do you think
we’re trying to annoy you?), but I guess that no one ever pointed out that
PtMessage is destroyed automatically or assumed that everyone knew. Now that
I know about this behaviour, I’ll update the docs.

: Anyway, why should I bother, since I have a feeling you stopped upgrading
: Photon under QNX4 … ;-(

We still maintain QNX 4 and Photon 1.14 – they’re still widely used. Take
a look at our website; there are updated Photon 1.14 docs there.


Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

Steve Reid <stever@qnx.com> wrote:

Marc Lupien <> marclupien@hotmail.com> > wrote:
: If this is the case then this behaviour is NOT documented and it really
: should be because it’s contrary to the normal behaviour of a widget where
: the creator keeps control of the destruction…

Don’t you consider it normal behaviour that clicking on a window’s Close
button also makes the PtWindow destroy itself? :wink:

\

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

“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:935gb9$ktg$1@nntp.qnx.com

Steve Reid <> stever@qnx.com> > wrote:
Marc Lupien <> marclupien@hotmail.com> > wrote:
: If this is the case then this behaviour is NOT documented and it
really
: should be because it’s contrary to the normal behaviour of a widget
where
: the creator keeps control of the destruction…

Don’t you consider it normal behaviour that clicking on a window’s Close
button also makes the PtWindow destroy itself? > :wink:

Yes Wojtek I consider it normal when I click a close button on a window,
because there are flags all over the place for PtWindow that allow the
programmer to specify what behaviour should be managed automatically and
what behaviour should not… It can be assumed easily… Sorry but your
comparison doesn’t stand in my opinion.

I’m sorry, but I was just frustrated because I lost close to half a day
figuring this one out. Maybe I’m just sloooowww.

I’m sure you’re all doing your best. I know that putting out proper
documentation is very hard and that you bust your chops trying to put out
good product, which you do! But if it was not for the source code for
PtMessage that I found lying in a photon toolkit directory somewhere, I
would never have suspected it and would have lost a lot more time.

Anyway, thanks again for all the good work, sincerely, sometime things falls
between cracks and that’s normal.

Bye, no angry feeling.

Marc Lupien <marclupien@hotmail.com> wrote:

“Wojtek Lerch” <> wojtek@qnx.com> > wrote in message
news:935gb9$ktg$> 1@nntp.qnx.com> …
Steve Reid <> stever@qnx.com> > wrote:
Marc Lupien <> marclupien@hotmail.com> > wrote:
: If this is the case then this behaviour is NOT documented and it
really
: should be because it’s contrary to the normal behaviour of a widget
where
: the creator keeps control of the destruction…

Don’t you consider it normal behaviour that clicking on a window’s Close
button also makes the PtWindow destroy itself? > :wink:

Yes Wojtek I consider it normal when I click a close button on a window,
because there are flags all over the place for PtWindow that allow the
programmer to specify what behaviour should be managed automatically and
what behaviour should not… It can be assumed easily… Sorry but your
comparison doesn’t stand in my opinion.

I don’t know…

Each of the two widgets we’re talking about has a button that makes
the widget disappear from the screen.

The docs for PtWindow talks about closing the window a few times
but I haven’t found it explained anywhere that closing means that
the widget is being destroyed rather than, for instance, just
unrealized.

The docs for PtMessage don’t mention either closing or destroying,
but I would be surprised if you said that you didn’t think that the
dialog is being closed when it disappears after you click on its
button.

So I would say that the analogy is pretty good…

BTW, I’m not being entirely serious here (did you notice the “;-)” in my
previous post?) – I definitely agree with you that it would be good to
mention in the docs that the widgets destroy themselves when you close
them by clicking on their buttons. But still, I think the main
difference between the two widgets’ behaviour is that we’re all used to
what PtWindow does simply because we use it a lot more often than
PtMessage…

I’m sorry, but I was just frustrated because I lost close to half a day
figuring this one out. Maybe I’m just sloooowww.

Another thing that bit you is that 1.14 is more sensitive to attempts to
destroy a widget twice – your code didn’t crash under 1.13…

I’m sure you’re all doing your best. I know that putting out proper
documentation is very hard and that you bust your chops trying to put out
good product, which you do! But if it was not for the source code for
PtMessage that I found lying in a photon toolkit directory somewhere, I
would never have suspected it and would have lost a lot more time.

Anyway, thanks again for all the good work, sincerely, sometime things falls
between cracks and that’s normal.

Bye, no angry feeling.

Good, I was worried for a few seconds… :slight_smile:


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

“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:936352$17n$1@nntp.qnx.com

Another thing that bit you is that 1.14 is more sensitive to attempts to
destroy a widget twice – your code didn’t crash under 1.13…

Ah yes, that’s probaly why I didn’t catch it before…

Thanks again for your help and everything, until next time…

Happy new year … :wink: