package require bells
bells %AUTO% | name ?options...?
abell configure ?options...?
abell cget option
This package provides a snit::type named
bell. Instances of
produce repeating patterns of beeps. Typically this is used to
alert users to conditions of alarm level severity.
Bells have a
-pattern which determines the interval
between each beep, and an
-interval which determines
the time between repetitions of the pattern.
Determines the time in milliseconds between repetitions of the beep pattern. If not supplied, this defaults to 1000 (one second). In the interval between patterns, the event loop is active.
Determines the interval between beeps in one repetition
of the pattern. The pattern begins with a beep after
which there is a delay that is determined by iterating
-pattern list after which
another beep is emitted.
The default is a single element of 100 which results in a double beep with the two beeps separated by 0.1 seconds.
Note that during the execution of the pattern, the event loop does not execute.
Instances of a bell are created using the bell command and, themselves become commands. The ways to create a bell command are:
The first example defines the command bellname
to represent an object of type
second example lets the bell command select
a unique command name and assigns it to he variable
In all cases the remainder of the command (if any) is made up of option-value pairs which override the default options (See OPTIONS above).
Once created, the command representing the object can be used to invoke several subcommands (Methods) on the bell object. These are listed and described below:
Destroys the object. Once this is done, the command that represents the objecdt is no longer defined
Change the configuration options for the object. If the bell is currently in the process of ringing, the options are changed and will take effect at the end of the current pattern. See OPTIONS above.
Returns the value of the configuration option optname. See OPTIONS above for a list of the legal option names.
Starts repetition of the bell pattern. Once started,
the pattern will continue as defined by the
OPTIONS until the program exits, the bell object is
destroyed or the
method is invoked.
Cancels the executing pattern. If the pattern is not executing, this is a no-op.
This example shows the full lifecycle of a bell object. In this case, the bell is configured to repeat every second, with a pattern of two short (50ms) delays and one long (100ms) delay.