Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Forcing and Catching a close event: (4 Items)
   
Forcing and Catching a close event  
I am developing an application using the Momentics IDE along with PhAB. 

When my app launches, it dislpays the main window with a second window on top (the logon window). 

What I need to do is two things: 

1. When the user successfully logs on, how do I force the logon window to close? 

2. Regardless of how the logon window closes, how do I catch the close event? 

If the user successfully logs on, then I need to be able to force the logon window to close, catch the close event and 
enable the main window. (Currently the logon window calls PtBlockAllWindows, I need to call PtUnblockWindows if the 
logon is successful) 

If the user does not successfully logon, then regardless of how they close the window ([X] button, Menu->Close, or a 
[Quit] button that I added to the interface) I need to catch the close event to make sure the entire application is 
closed. 

I am currently using the Window Manager (Pt_CB_WINDOW) callback and it catches the close event when the [X] button or 
the Menu->Close options are used. However, it does not catch the [Quit] button that I added which uses the Activate 
(Pt_CB_ACTIVATE) callback and the Code Type of "Done". 

I appreciate any help 

Kendall
Re: Forcing and Catching a close event  
1. PtUnrealizeWidget() or PtDestroyWidget(), use the last one if you no longer need the window

2. Look at this doc
http://www.qnx.com/developers/docs/6.5.0/topic/com.qnx.doc.photon_prog_guide/window_mgmt.html#NotificationCallback
and the example code.
Re: Forcing and Catching a close event  
3. Attach Pt_CB_UNREALIZED to the logon window -- it will be called whenever the window is unrealized (whatever the 
reason is).
Re: Forcing and Catching a close event  

Thank you very much.  All of your suggestions solved the problems.

Kendall