The following tables list the Tcl commands added by Tk. Table 21-1 lists commands that create widgets. There are 15 different widgets in Tk, although 4 of them are variations on a button, and 5 are devoted to different flavors of text display. Table 21-2 lists commands that manipulate widgets and provide associated functions like input focus, event binding, and geometry management. Table 21-3 lists several support procedures that implement standard dialogs, option menus, and other facilities. The page number in the table is the primary reference for the command, and there are other references in the index.
Table 21-1. Tk widget-creation commands.
Command
Pg.
Description
button
388
Create a command button.
checkbutton
392
Create a toggle button that is linked to a Tcl variable.
radiobutton
392
Create one of a set of radio buttons linked to one variable.
menubutton
396
Create a button that posts a menu.
menu
396
Create a menu.
canvas
475
Create a canvas, which supports lines, boxes, bitmaps, images, arcs, text, polygons, and embedded widgets.
label
420
Create a read-only, one-line text label.
entry
437
Create a one-line text entry widget.
message
422
Create a read-only, multiline text message.
listbox
443
Create a line-oriented, scrolling text widget.
text
453
Create a general-purpose, editable text widget.
scrollbar
429
Create a scrollbar that can be linked to another widget.
scale
425
Create a scale widget that adjusts the value of a variable.
frame
417
Create a container widget used with geometry managers.
toplevel
417
Create a frame that is a new top level window.
Table 21-2. Tk widget-manipulation commands.
Command
Pg.
Description
bell
428
Ring the terminal bell device.
bind
369
Bind a Tcl command to an event.
bindtags
371
Create binding classes and control binding inheritance.
clipboard
510
Manipulate the clipboard.
destroy
521
Delete a widget.
event
380
Define and generate virtual events.
focus
518
Control the input focus.
font
555
Set and query font attributes and measurements.
grab
520
Steal the input focus from other widgets.
grid
358
Arrange widgets into a grid with constraints.
image
542
Create and manipulate images.
lower
349
Lower a window in the stacking order.
option
409
Set and query the resources database.
pack
348
Pack a widget in the display with constraints.
place
367
Place a widget in the display with positions.
raise
349
Raise a window in the stacking order.
selection
509
Manipulate the selection.
send
562
Send a Tcl command to another Tk application.
tk
582
Query or set the application name.
tkerror
190
Handler for background errors.
tkwait
520
Wait for an event.
update
524
Update the display by going through the event loop.