Page 1 of 1

Handle the window's close button on Mac

Posted: Fri Dec 16, 2016 8:17 pm
by Mag
I'm having some difficulties to handle the close box button on Mac app, I would like it does the same as when user uses the Command-W menu item but I can't find a reliable way.

To date my trials was with the on closeStack message but this creates a cascading series of problems, you can imagine...

There is not a specific message to trap, right?

Re: Handle the window's close button on Mac

Posted: Fri Dec 16, 2016 8:55 pm
by richmond62
I'm not entirely sure what you mean by your message:

unlike on Windows or Linux the CMD-W (equivalent to CTRL-W on Windows or Linux) closes a window, but does NOT
quit a program . . .

if you can explain things a bit more clearly I may be able to help.

Re: Handle the window's close button on Mac

Posted: Fri Dec 16, 2016 8:56 pm
by Klaus
Hi Mag,

maybe catching "on closestackrequest" will do?


Best

Klaus

Re: Handle the window's close button on Mac

Posted: Sat Dec 17, 2016 1:30 pm
by Mag
Thank you, I handled all in closestackrequest as you suggested Klaus.

PS
I richmond62, sorry, I made a bit of confusion describing my problem... :oops: fortunately Klaus was able to read between the lines ...