PtMakeModal & PtBlockAllWindows don't work with ApCreateModu

I’ve created a dialog with Photon and using ApCreateModule to display it.

In the `Window Opening’ callback I’ve tried using PtMakeModal() and also
PtBlockAllWindows() to make the newly created dialog modal and block all
other windows in the application, however this doesn’t work and all other
windows remain unblocked.

Using PtMakeModal() and PtBlockAllWindows() with dialogs invoked via links
always works.

Help!

Simon Platten

Hello,

Take a look at the modal dialog section found in the following page.
http://qdn.qnx.com/support/docs/photon20/prog_guide/lengthy.html

Regards,
Dave B.



Simon Platten <simon.platten@brisco-eng.co.uk> wrote:

I’ve created a dialog with Photon and using ApCreateModule to display it.

In the `Window Opening’ callback I’ve tried using PtMakeModal() and also
PtBlockAllWindows() to make the newly created dialog modal and block all
other windows in the application, however this doesn’t work and all other
windows remain unblocked.

Using PtMakeModal() and PtBlockAllWindows() with dialogs invoked via links
always works.

Help!

Simon Platten

Thank you,

I’ve looked at the referred page and will implement the example, however at
the moment I remain sceptical as the example BlockWindows() routine is
virtually identical to the code I wrote myself before I discovered the
PtBlockWindow and PtBlockAllWindows routines which do exactly the same.

What is the difference? What am I missing, thats not explained in the
lengthy.html?

Regards,
Simon Platten

“Applications Mail Group” <apps@qnx.com> wrote in message
news:9j23it$302$1@nntp.qnx.com

Hello,

Take a look at the modal dialog section found in the following page.
http://qdn.qnx.com/support/docs/photon20/prog_guide/lengthy.html

Regards,
Dave B.



Simon Platten <> simon.platten@brisco-eng.co.uk> > wrote:
I’ve created a dialog with Photon and using ApCreateModule to display
it.

In the `Window Opening’ callback I’ve tried using PtMakeModal() and also
PtBlockAllWindows() to make the newly created dialog modal and block all
other windows in the application, however this doesn’t work and all
other
windows remain unblocked.

Using PtMakeModal() and PtBlockAllWindows() with dialogs invoked via
links
always works.

Help!

Simon Platten

Having implemented the following:

PtWidget_t* pWin = ApCreateModule(ABM_MyDlg, NULL, NULL);

if (pWin == NULL)
return;
dClosed = 0;
pBlockList = PtBlockAllWindows(pWin, 0, 0);
PtModalStart();

while(!dClosed)
PtProcessEvent();
PtModalEnd();

if (pBlockList != NULL)
PtUnblockWindows(pBlockList);

dClosed is incremented in the `Window Closing’ call back and is declared as
static to the entire module.

My modal dialog now works, thank you for your assistance. I would like to
suggest that where routines like PtMakeModal() have instances where they
cannot be used that the help is modified to reflect this.

I hope you find the above constructive.

Regards,
Simon Platten.

“Applications Mail Group” <apps@qnx.com> wrote in message
news:9j23it$302$1@nntp.qnx.com

Hello,

Take a look at the modal dialog section found in the following page.
http://qdn.qnx.com/support/docs/photon20/prog_guide/lengthy.html

Regards,
Dave B.



Simon Platten <> simon.platten@brisco-eng.co.uk> > wrote:
I’ve created a dialog with Photon and using ApCreateModule to display
it.

In the `Window Opening’ callback I’ve tried using PtMakeModal() and also
PtBlockAllWindows() to make the newly created dialog modal and block all
other windows in the application, however this doesn’t work and all
other
windows remain unblocked.

Using PtMakeModal() and PtBlockAllWindows() with dialogs invoked via
links
always works.

Help!

Simon Platten

Simon Platten <simon.platten@brisco-eng.co.uk> wrote:
: My modal dialog now works, thank you for your assistance. I would like to
: suggest that where routines like PtMakeModal() have instances where they
: cannot be used that the help is modified to reflect this.

The docs on the QDN website are old; we’re in the process of updating them.
You’re better off referring to the docs that came with your download. The
section on modal dialogs that’s in the QNX 6.1.0 docs has been reviewed and
updated.


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