Skip navigation.
Home
The QNX Community Portal

View topic - Code after a call to PtMainLoop

Code after a call to PtMainLoop

Isn't the name clear?

Code after a call to PtMainLoop

Postby m2asseli » Thu Aug 30, 2007 2:32 pm

Hello,

I am writing a GUI program and would like to clean-up after the user has closed the main window. I create the main window and widgets, then call the main loop:

int main()
{
...
InitWndAndWidgets();
...
PtMainLoop();

CleanUpCode();

return 1;
}

Code is never executed after PtMainLoop(), i.e. I never get to CleanUpCode(). I am assuming there is some event emitted when the main window is closed, which is captured by PtMainLoop(). Can I attach my own code when this event is captured? Or is there a way to have code executed after a call to PtMainLoop()?

Thanks.
Matt.
m2asseli
Senior Member
 
Posts: 100
Joined: Tue May 11, 2004 7:26 pm

RE: Code after a call to PtMainLoop

Postby micro » Thu Aug 30, 2007 3:39 pm

You would like to set the Pt_ARG_WINDOW_NOTIFY_FLAGS according to your needs.
Then in the Pt_CB_WINDOW Callback you could check if the window has to be closed and clean up there.

A good topic for this is "Window Management" in "Photon MicroGUI-Programmers Guide"
micro
Senior Member
 
Posts: 458
Joined: Thu Jul 22, 2004 8:41 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 1 guest