www.gibmonks.com

  Previous section   Next section

Practical Programming in Tcl & Tk, Third Edition
By Brent B. Welch

Table of Contents
Chapter 29.  Simple Tk Widgets


The bell Command

The bell command rings the terminal bell. The bell is associated with the display; even if you are executing your program on a remote machine, the bell is heard by the user. If your application has windows on multiple displays, you can direct the bell to the display of a particular window with the -displayof option. The syntax for the bell command is given below:

bell ?-displayof window?

UNIX has an xset program that controls the bell's duration, pitch, and volume. The volume is in percent of a maximum, for example, 50. In practice, many keyboard bells only support a variable duration; the pitch and volume are fixed. The arguments of xset that control the bell are shown below.

exec xset b ?volume? ?hertz? ?milliseconds?

The b argument by itself resets the bell to the default parameters. You can turn the bell off with -b, or you can use the on or off arguments.

exec xset -b
exec xset b ?on? ?off?

      Previous section   Next section
    Top