Skip navigation.
Home
The QNX Community Portal

View topic - Shutdown an Application

Shutdown an Application

Isn't the name clear?

Shutdown an Application

Postby prinz » Mon May 25, 2009 11:33 am

hi guys!
i have to shutdown a PhAB Application after running it with pressing a Button.
(it shouldn´t be only a quit button as in the Tutorial).
can anyone help me!

thank you
prinz
Active Member
 
Posts: 23
Joined: Tue Mar 24, 2009 11:37 am

Postby neoman » Mon May 25, 2009 11:59 am

Create an Activate callback on the PtButton widget of your choice and in the created callback use

http://www.qnx.com/developers/docs/6.3. ... texit.html

this function to close your application.
neoman
Active Member
 
Posts: 46
Joined: Wed Oct 16, 2002 8:39 am

Postby prinz » Wed May 27, 2009 12:43 pm

Thx neoman,
i tried the PtExit function separately, it worked fine. but when i put it in my project, the graphic blocks the Button, and i can´t click on it.
is there any Solution.
thx
prinz
Active Member
 
Posts: 23
Joined: Tue Mar 24, 2009 11:37 am

Postby neoman » Wed May 27, 2009 7:20 pm

What do you mean by "the graphic blocks the button"?

Explain this more detailled please :-)
neoman
Active Member
 
Posts: 46
Joined: Wed Oct 16, 2002 8:39 am

Postby prinz » Wed May 27, 2009 9:07 pm

Hi neo,
i had to program an IPC Application where the client should be Graphic.

here is the Explanation
http://www.openqnx.com/index.php?name=P ... 6465#46465

All works fine, the server becomes the FTP data from the PLC modul and the update of the Graphic works.
now i have to shutdown the Application through clicking on one Button.
i tried it with PtExit as u said in the last post, but the update of the graphic blocks the Button, and it becomes disabled.

i think , i should end the process to get the button enabled, but i dont know how to do it.
prinz
Active Member
 
Posts: 23
Joined: Tue Mar 24, 2009 11:37 am

Postby neoman » Thu May 28, 2009 8:12 am

If the button is blocked, you can reenable it by unsetting the Pt_BLOCKED resource on the button widget (but this is more a hack than a real solution).

If you want to end the process, you can use kill:

http://www.qnx.com/developers/docs/6.4. ... /kill.html

I guess you are german. If you have more questions, you can also ask in german in a private message!

André
neoman
Active Member
 
Posts: 46
Joined: Wed Oct 16, 2002 8:39 am

Postby Thunderblade » Fri May 29, 2009 3:10 pm

It sounds to me as if he's doing some never-returning operation in some other callback, so the whole GUI part is not active. If that's the case, you should create a separate thread - your Photon callbacks always should return as soon as possible.
Thunderblade
Senior Member
 
Posts: 487
Joined: Thu Apr 07, 2005 11:52 am

Postby neoman » Fri May 29, 2009 3:20 pm

He told me by mail that he blocks his main thread with MsgSend which is a blocking operation.

I also advised him to use threads ;-)
neoman
Active Member
 
Posts: 46
Joined: Wed Oct 16, 2002 8:39 am


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 1 guest