Shutdown an Application

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

Create an Activate callback on the PtButton widget of your choice and in the created callback use … texit.html

this function to close your application.

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.

What do you mean by “the graphic blocks the button”?

Explain this more detailled please :slight_smile:

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

here is the Explanation … 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.

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: … /kill.html

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


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.

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 ;-)