Handle the window's close button on Mac

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Handle the window's close button on Mac

Post by Mag » Fri Dec 16, 2016 8:17 pm

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?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Handle the window's close button on Mac

Post by richmond62 » Fri Dec 16, 2016 8:55 pm

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.

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Handle the window's close button on Mac

Post by Klaus » Fri Dec 16, 2016 8:56 pm

Hi Mag,

maybe catching "on closestackrequest" will do?


Best

Klaus

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Handle the window's close button on Mac

Post by Mag » Sat Dec 17, 2016 1:30 pm

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 ...

Post Reply