is PtAskQuestion.c obsolete under 1.14 ?

I have a function in library that was based on the source
/qnx4/phtk/src/examples/PtAskQuestion.c (photon 1.13 and earlier I think).

I recently upgraded my development computer to Photon 1.14 and I get a
compile error saying that there’s no prototype for PtBuildWidget().

I also noticed that /qnx4/phtk/src/examples/PtAskQuestion.c is no longer
supplied with photon 1.14.

Can someone please tell me which direction to go in upgrading my function ?
what is the official way now that PtAskQuestion seems to be something from
the past ?

TIA

marclupien@hotmail.com

“Marc Lupien” <marclupien@hotmail.com> wrote in message
news:931sjl$hh9$1@inn.qnx.com

I have a function in library that was based on the source
/qnx4/phtk/src/examples/PtAskQuestion.c (photon 1.13 and earlier I think).

I recently upgraded my development computer to Photon 1.14 and I get a
compile error saying that there’s no prototype for PtBuildWidget().

I also noticed that /qnx4/phtk/src/examples/PtAskQuestion.c is no longer
supplied with photon 1.14.

Can someone please tell me which direction to go in upgrading my function
?
what is the official way now that PtAskQuestion seems to be something from
the past ?

that’s quite strange becouse PtAskQustion() works well with my phtk
1.14A
rather as with previous phtk versions. it’s deprecated in phtk 2.0 but i
guess
should work well under 1.1x

TIA

marclupien@hotmail.com

// wbr

Ian Zagorskih
Novosoft CyBearNet Department
Custom software development and web design since 1992
E-mail: ianzag@novosoft.ru
Phone: +7 (3832) 39-72-60, 39-72-61
Fax: +7 (3832) 39-63-58
For more visit www.novosoft-us.com

Marc Lupien <marclupien@hotmail.com> wrote:
: I have a function in library that was based on the source
: /qnx4/phtk/src/examples/PtAskQuestion.c (photon 1.13 and earlier I think).

: I recently upgraded my development computer to Photon 1.14 and I get a
: compile error saying that there’s no prototype for PtBuildWidget().

: I also noticed that /qnx4/phtk/src/examples/PtAskQuestion.c is no longer
: supplied with photon 1.14.

: Can someone please tell me which direction to go in upgrading my function ?
: what is the official way now that PtAskQuestion seems to be something from
: the past ?

PtAskQuestion() has been in the Photon libraries since the beginning (as far
as I can tell), so you don’t really need the C code for it at all. I’d
suggest you try to compile and link your application without PtAskQuestion.c.

As someone else mentioned, PtAskQuestion() has been deprecated in Photon 2.0,
but is still in the libraries.


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

“Steve Reid” <stever@qnx.com> wrote in message
news:9323p9$lsa$1@nntp.qnx.com

Marc Lupien <> marclupien@hotmail.com> > wrote:
: I have a function in library that was based on the source
: /qnx4/phtk/src/examples/PtAskQuestion.c (photon 1.13 and earlier I
think).

: I recently upgraded my development computer to Photon 1.14 and I get a
: compile error saying that there’s no prototype for PtBuildWidget().

: I also noticed that /qnx4/phtk/src/examples/PtAskQuestion.c is no longer
: supplied with photon 1.14.

: Can someone please tell me which direction to go in upgrading my
function ?
: what is the official way now that PtAskQuestion seems to be something
from
: the past ?

PtAskQuestion() has been in the Photon libraries since the beginning (as
far
as I can tell), so you don’t really need the C code for it at all. I’d
suggest you try to compile and link your application without
PtAskQuestion.c.

As someone else mentioned, PtAskQuestion() has been deprecated in Photon
2.0,
but is still in the libraries.

Ok, my mistake, I misled you (and myself :wink: ). I had a macro that
transformed calls to PtAskQuestion into calls to PuAskQuestion (notice the
Pu which stands for my Photon User library of functions). PuAskQuestion is
something I made based on the old PtAskQuestion source that used to be
supplied with Photon 1.13 and earlier. So I was never refering to the real
PtAskQuestion … sorry again for this mistake.

PuAskQuestion on the other hand still had a compile error because it used
PtBuildWidget (which needs to be changed to PtCreateWidget) and also a
run-time error…

PuAskQuestion creates a PtMessage widget and and invokes it in a ‘modal’
way. It then waits for the user to select a button and then it tried to
PtDestroyWidget() the PtMessage widget just created and this gave me a
SIGSEGV !!!

After a while, I figured out, even though the doc doesn’t mention this
that the PtMessage widget destroys itself automatically when the user
presses one of the buttons. So I was really trying to destroy the PtMessage
widget twice…

Thanks for you help anyway and again, sorry for posting a message before
having done my own homework…

Marc.

Marc Lupien <marclupien@hotmail.com> wrote:
: After a while, I figured out, even though the doc doesn’t mention this
: that the PtMessage widget destroys itself automatically when the user
: presses one of the buttons. So I was really trying to destroy the PtMessage
: widget twice…

A good point; I’ll mention it in the docs. Thanks.

You’ll be pleased to hear that PtMessage has been deprecated in Photon 2.0,
too. :slight_smile:


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

“Steve Reid” <stever@qnx.com> wrote in message
news:934lqf$6n9$1@nntp.qnx.com

Marc Lupien <> marclupien@hotmail.com> > wrote:
: After a while, I figured out, even though the doc doesn’t mention this
: that the PtMessage widget destroys itself automatically when the user
: presses one of the buttons. So I was really trying to destroy the
PtMessage
: widget twice…

A good point; I’ll mention it in the docs. Thanks.

You’ll be pleased to hear that PtMessage has been deprecated in Photon
2.0,
too. > :slight_smile:

Can you tell me what’s the equivalent widget in Photon 2.0 then ?


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

I had the same problem. I had my own PtAskQuestion() function, so I could
create the buttons in a size usable by touch screen application. After some
discussion with QNX folks I went the following route:
In my application, I have a PhAB created “Error-Window”. In it’s setup
function I return Pt_END, so it won’t be realized too soon. In my
PtAskQuestion() the Error-Dialog is created with ApCreateModule() and all
widgets are setup according to the parameters of PtAskQuestion(). Then it’s
realized. The rest, e.g. waiting for user action, is similar to the original
Photon PtAskQuestion() function.

Markus

Marc Lupien <marclupien@hotmail.com> schrieb in im Newsbeitrag:
935tp0$uf$1@inn.qnx.com

“Steve Reid” <> stever@qnx.com> > wrote in message
news:934lqf$6n9$> 1@nntp.qnx.com> …
Marc Lupien <> marclupien@hotmail.com> > wrote:
: After a while, I figured out, even though the doc doesn’t mention
this

: that the PtMessage widget destroys itself automatically when the user
: presses one of the buttons. So I was really trying to destroy the
PtMessage
: widget twice…

A good point; I’ll mention it in the docs. Thanks.

You’ll be pleased to hear that PtMessage has been deprecated in Photon
2.0,
too. > :slight_smile:

Can you tell me what’s the equivalent widget in Photon 2.0 then ?


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