beetlebug▾
/

bell

Rings the bell of the display: in ztk, the command checks its options and makes no sound.

bell ?-displayof WINDOW? ?-nice?

Description

In Tk, bell makes the sound of the display, such as a short beep, to tell the user about a bad key or a bad value. ztk has no sound, so bell makes no sound and shows no change. A script can call bell with no test of the platform.

The command checks that each word is -displayof or -nice. It does not check the window of -displayof.

Options

OptionTypeDefaultDescription
-displayofwindownoneThe window whose display rings the bell.
-niceflagnoneRings the bell with no reset of the screen saver.

-displayof WINDOW

The window whose display rings the bell.

In Tk, the bell rings on the display of WINDOW. ztk has one display for each app, so the value has no effect. ztk does not check that WINDOW exists.

% bell -displayof .

ztk accepts any value of -displayof.

-nice

Rings the bell with no reset of the screen saver.

In Tk on X11, a bell also resets the screen saver, and -nice leaves the screen saver as it is. ztk makes no sound and does not touch the screen saver, so the flag has no effect.

% bell -nice

The flag has no value, and a call with it does not fail.

Returns

An empty string.

Examples

% bell

# A binding that rings the bell on a key the entry does not use.
% entry .e
> bind .e <Key-Escape> {bell}
> bind .e <Key-Escape>
bell

Errors

% bell -foo
bad option "-foo": must be -displayof or -nice
-errorcode NONE

% bell now
bad option "now": must be -displayof or -nice
-errorcode NONE

Differences from Tcl

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1