Busy

A component of this type resides in the system module. It is used to mark the system "busy." While busy, the system will accept no user input.

To make the system "busy" for a few seconds while completing some intense computation, most applications will use code like the following:

system:busy!Enter()
...intense computation...
system:busy!Leave()

Applications may create and use their own Busy components.

Busy Properties

Standard Properties:
class, parent, proto, version.

busyCount integer (0-32767)
This read-only property is the current "busy" count. If it is greater than zero, the system is busy and will ignore user input. This count increments each time !Enter() is invoked, and decrements each time !Leave() is invoked.

busyTotal integer (0-32767)
This read-only property is the sum of all the device's Busy components' busyCount properties. If it is greater than zero, the system is busy and will ignore user input.

Busy Events

_busyTotalChanged()

_busyTotalChanged( self AS busy )

Called whenever busyTotal becomes zero or non-zero, indicating that the busy status needs to be changed. Used by the System Module to know when to display busy status.

Pass:

self busy
The component experiencing the event.

Busy Actions

Enter()

Enter()

This property marks the system as "busy": the system will accept no user input, and may put up some busy indicator, such as an hourglass or wristwatch icon.

If your program is about to carry out some intense computation that will slow down the device for 1 - 4 seconds, warn the user by marking the system busy (and marking the system not busy when done).

REM We're beginning a time-intensive operation, so mark system busy.
system:busy.Enter()

ComputeAllTotals()
UpdateAllNumbers()

REM We're done with the time-intensive operation, so mark system not busy.
system:busy.Leave()

If you will be slowing down the system for more than four seconds, consider providing feedback to the user so they will know the system hasn't crashed. You might want to give the user some idea of what percent of the task has been completed. You may not want to mark the system busy in these cases: instead, you might want to provide a way for the user to cancel the operation.

The user would have no way to access this if the system has been marked busy.

Leave()

Leave()

Undo the effects of a previous invocation of the Enter() action.