Fourth World Logo Fourth World Media Corporation
  Embassy Services Products Resources   About Fourth World Contact  


IncWell Logo

SuperCard FAQ

4W Logo

How can my project tell if SuperCard is running in the background?


SuperCard has a global property called "the foreground" which returns true if SuperCard is the front-most application, and false if another application is in front.

This is most commonly used in an "idle" handler, as in:

on idle
if the foreground is true then
-- do foreground stuff
else
-- do background stuff
end if
end idle

If you do use an "idle" handler, you may find it useful to note that SuperTalk includes a global property called "idleTicks", which determines the number of ticks (roughly 60ths of a second) in between SuperCard's sending of the "idle" message to your project. This can be used with both "get" and "set". The idleTicks is initialized to 1 and is not reset at idle time.