how to wait for a dialog return in my application code

Hi Folks,

I use “ApCreateModule” to create a dialog, in my application code, I want to wait until user click “done” button on this dialog to continue, how can i realize it? use wait for event or message function? what are they?

Thanks!

It’s not clear what you are asking. Do you want to konw how to realize a button in the dialog, or do you want to know who to know when the user has pushed the button. Assuming it is the more likely second possibility, you should add an Activate callback to the “Done” button.

It just likes a message box in windows. I create the dialog from my main code (using ApCreateModule), then right after it, the main program should stall there until user click some button on the dialog. Here’s the example of my main code: (the implement of dialog code is in other file)

//create dialog
ApCreateModule(ABM_my_message_box, NULL, NULL);

//wait until user click “done” button on the dialog
WaitforEvent();//???

//do the next work on the main code
initAD();

Well, plainly, Photon does not work this way. Take a look at my previous posting, it has your answer.

Depending on what you want to achive (and which QNX you are using) perhaps PtNotice() with Pt_MODAL flag set would do the trick (this is for QNX 6).

I’ve figured out how to do it. The ‘PtModuleBlock/PtModuleUnblock’ are right for my need.