Best practice for when an app is sent to the background?
martyknappster at gmail.com
Thu Jul 23 18:46:00 CEST 2015
If you want to know when a user switches to a different app you can use
"suspend" and then "resume" to detect when they come back.
> I have a multi-window (stack) desktop application. In working on some
> recent enhancements to the app, I got to thinking about the apps
> behavior when a user clicks on a 3rd party app (sending the app to the
> background) or minimized/iconifies one or more windows of the app.
> Specifically handing the messages:
> suspendStack and resumeStack
> iconifyStack and unIconifyStack
> Does anyone out there have any "best practice:" guidance on how these
> two message pairs should be handled - how similar are they or what are
> the subtle or not so subtle differences in how they should be handled. I
> realize that if you just click on another app's window, or another
> stack/window in the app, a suspendstack message is sent but not
> iconifyStack. If you minimize a window, an suspendStack message and then
> an iconifyStack message is sent in that order (with uniconifyStack and
> resumeStack being sent when restored).
> So it appears to me that iconifyStack/unIconifyStack only need to be
> handled is there is something specific your want to do on
> minimization/iconification that your would not normally do when a stack
> is suspended?
> Does anyone know of a technique to differentiate in suspendStack whether
> the user is just switching to a different stack/window in the same app
> or to a 3rd party app?
More information about the use-livecode