Package tk

The graphical toolkit for the Tcl scripting language

http://tcl.sourceforge.net

When paired with the Tcl scripting language, Tk provides a fast and powerful
way to create cross-platform GUI applications.

General Commands (Section 1)
wish
Wish is a simple program consisting of the Tcl command language, the Tk toolkit, and a main program that reads commands from standard input or from a file. It...
Tcl/Tk Keywords (Section n)
bell
This command rings the bell on the display for window and returns an empty string. If the -displayof option is omitted, the display of the application's main...
bind
The bind command associates Tcl scripts with X events. If all three arguments are specified, bind will arrange for script (a Tcl script) to be evaluated...
bindtags
When a binding is created with the bind command, it is associated either with a particular window such as .a.b.c, a class name such as Button, the keyword all...
bitmap
A bitmap is an image whose pixels can display either of two colors or be transparent. A bitmap image is defined by four things: a background color, a foreground...
busy
The tk busy command provides a simple means to block keyboard, button, and pointer events from Tk widgets, while overriding the widget's cursor with a...
button
The button command creates a new window (given by the pathName argument) and makes it into a button widget. Additional options, described above, may be...
canvas
The canvas command creates a new window (given by the pathName argument) and makes it into a canvas widget. Additional options, described above, may be...
checkbutton
The checkbutton command creates a new window (given by the pathName argument) and makes it into a checkbutton widget. Additional options, described above, may...
clipboard
This command provides a Tcl interface to the Tk clipboard, which stores data for later retrieval using the selection mechanism (via the -selection CLIPBOARD...
colors
Tk recognizes many symbolic color names (e.g., red) when specifying colors.
console
The console window is a replacement for a real console to allow input and output on the standard I/O channels on platforms that do not have a real console. It...
cursors
The -cursor widget option allows a Tk programmer to change the mouse cursor for a particular widget.
destroy
This command deletes the windows given by the window arguments, plus all of their descendants. If a window “.” is deleted then all windows will be destroyed and...
entry
The entry command creates a new window (given by the pathName argument) and makes it into an entry widget. Additional options, described above, may be specified...
event
The event command provides several facilities for dealing with window system events, such as defining virtual events and synthesizing events. The command has...
focus
The focus command is used to manage the Tk input focus. At any given time, one window on each display is designated as the focus window; any key press or key...
font
The font command provides several facilities for dealing with fonts, such as defining named fonts and inspecting the actual attributes of a font. The command...
fontchooser
The tk fontchooser command controls the Tk font selection dialog. It uses the native platform font selection dialog where available, or a dialog implemented in...
frame
The frame command creates a new window (given by the pathName argument) and makes it into a frame widget. Additional options, described above, may be specified...
geometry
Variables used or set by Tk
grab
This command implements simple pointer and keyboard grabs for Tk. Tk's grabs are different than the grabs described in the Xlib documentation. When a grab is...
grid
The grid command is used to communicate with the grid geometry manager that arranges widgets in rows and columns inside of another window, called the geometry...
image
The image command is used to create, delete, and query images. It can take several different forms, depending on the option argument.
keysyms
Tk recognizes many keysyms when specifying key bindings (e.g., “bind . <Key-keysym>”). The following list enumerates the keysyms that will be recognized by Tk...
label
The label command creates a new window (given by the pathName argument) and makes it into a label widget. Additional options, described above, may be specified...
labelframe
The labelframe command creates a new window (given by the pathName argument) and makes it into a labelframe widget. Additional options, described above, may be...
listbox
The listbox command creates a new window (given by the pathName argument) and makes it into a listbox widget. Additional options, described above, may be...
lower
If the belowThis argument is omitted then the command lowers window so that it is below all of its siblings in the stacking order (it will be obscured by any...
menu
The menu command creates a new top-level window (given by the pathName argument) and makes it into a menu widget. That menu widget can either be used as a...
menubutton
The menubutton command creates a new window (given by the pathName argument) and makes it into a menubutton widget. Additional options, described above, may be...
message
The message command creates a new window (given by the pathName argument) and makes it into a message widget. Additional options, described above, may be...
option
The option command allows you to add entries to the Tk option database or to retrieve options from the database. The add form of the command adds a new option...
options
This manual entry describes the common configuration options supported by widgets in the Tk toolkit. Every widget does not necessarily support every option (see...
pack
The pack command is used to communicate with the packer, a geometry manager that arranges the children of a parent by packing them in order around the edges of...
pack_old
Note: this manual entry describes the syntax for the pack command as it existed before Tk version 3.3. Although this syntax continues to be supported for...
panedwindow
The panedwindow command creates a new window (given by the pathName argument) and makes it into a panedwindow widget. Additional options, described above, may...
photo
A photo is an image whose pixels can display any color or be transparent. A photo image is stored internally in full color (32 bits per pixel), and is displayed...
place
The placer is a geometry manager for Tk. It provides simple fixed placement of windows, where you specify the exact size and location of one window, called the...
radiobutton
The radiobutton command creates a new window (given by the pathName argument) and makes it into a radiobutton widget. Additional options, described above, may...
raise
If the aboveThis argument is omitted then the command raises window so that it is above all of its siblings in the stacking order (it will not be obscured by...
safe_loadTk
Safe Tk is based on Safe Tcl, which provides a mechanism that allows restricted and mediated access to auto-loading and packages for safe interpreters. Safe Tk...
scale
The scale command creates a new window (given by the pathName argument) and makes it into a scale widget. Additional options, described above, may be specified...
scrollbar
The scrollbar command creates a new window (given by the pathName argument) and makes it into a scrollbar widget. Additional options, described above, may be...
selection
This command provides a Tcl interface to the X selection mechanism and implements the full selection functionality described in the X Inter-Client Communication...
send
This command arranges for cmd (and args) to be executed in the application named by app. It returns the result or error from that command execution. App may be...
spinbox
The spinbox command creates a new window (given by the pathName argument) and makes it into a spinbox widget. Additional options, described above, may be...
text
The text command creates a new window (given by the pathName argument) and makes it into a text widget. Additional options, described above, may be specified on...
tk
The tk command provides access to miscellaneous elements of Tk's internal state. Most of the information manipulated by this command pertains to the application...
tk_chooseColor
The procedure tk_chooseColor pops up a dialog box for the user to select a color.
tk_chooseDirectory
The procedure tk_chooseDirectory pops up a dialog box for the user to select a directory.
tk_dialog
This procedure is part of the Tk script library. It is largely deprecated by the tk_messageBox.
tkerror
Note: as of Tk 4.1 the tkerror command has been renamed to bgerror because the event loop (which is what usually invokes it) is now part of Tcl. For backward...
tk_focusNext
tk_focusNext is a utility procedure used for keyboard traversal. It returns the “next” window after window in focus order. The focus order is determined by the...
tk_getOpenFile
The procedures tk_getOpenFile and tk_getSaveFile pop up a dialog box for the user to select a file to open or save. The tk_getOpenFile command is usually...
tk_mac
Access Mac-Specific Functionality on OS X from Tk
tk_menuBar
These procedures were used in Tk 3.6 and earlier releases to help manage pulldown menus and to implement keyboard traversal of menus. In Tk 4.0 and later...
tk_messageBox
This procedure creates and displays a message window with an application-specified message, an icon and a set of buttons. Each of the buttons in the message...
tk_optionMenu
This procedure creates an option menubutton whose name is pathName, plus an associated menu. Together they allow the user to select one of the values given by...
tk_popup
This procedure posts a menu at a given position on the screen and configures Tk so that the menu and its cascaded children can be traversed with the mouse or...
tkwait
The tkwait command waits for one of several things to happen, then it returns without taking any other actions. The return value is always an empty string. If...
toplevel
The toplevel command creates a new toplevel widget (given by the pathName argument). Additional options, described above, may be specified on the command line...
ttk_button
A ttk::button widget displays a textual label and/or image, and evaluates a command when pressed.
ttk_checkbutton
A ttk::checkbutton widget is used to show or change a setting. It has two states, selected and deselected. The state of the checkbutton may be linked to a Tcl...
ttk_combobox
A ttk::combobox combines a text field with a pop-down list of values; the user may select the value of the text field from among the values in the list.
ttk_entry
An ttk::entry widget displays a one-line text string and allows that string to be edited by the user. The value of the string may be linked to a Tcl variable...
ttk_frame
A ttk::frame widget is a container, used to group other widgets together.
ttk_image
The image element factory creates a new element in the current theme whose visual appearance is determined by Tk images. imageSpec is a list of one or more...
ttk_intro
The Tk themed widget set is based on a revised and enhanced version of TIP #48 (http://tip.tcl.tk/48) specified style engine. The main concepts are described...
ttk_label
A ttk::label widget displays a textual label and/or image. The label may be linked to a Tcl variable to automatically change the displayed text.
ttk_labelframe
A ttk::labelframe widget is a container used to group other widgets together. It has an optional label, which may be a plain text string or another widget.
ttk_menubutton
A ttk::menubutton widget displays a textual label and/or image, and displays a menu when pressed.
ttk_notebook
A ttk::notebook widget manages a collection of windows and displays a single one at a time. Each slave window is associated with a tab, which the user may...
ttk_panedwindow
A ttk::panedwindow widget displays a number of subwindows, stacked either vertically or horizontally. The user may adjust the relative sizes of the subwindows...
ttk_progressbar
A ttk::progressbar widget shows the status of a long-running operation. They can operate in two modes: determinate mode shows the amount completed relative to...
ttk_radiobutton
ttk::radiobutton widgets are used in groups to show or change a set of mutually-exclusive options. Radiobuttons are linked to a Tcl variable, and have an...
ttk_scale
A ttk::scale widget is typically used to control the numeric value of a linked variable that varies uniformly over some range. A scale displays a slider that...
ttk_scrollbar
ttk::scrollbar widgets are typically linked to an associated window that displays a document of some sort, such as a file being edited or a drawing. A scrollbar...
ttk_separator
A ttk::separator widget displays a horizontal or vertical separator bar.
ttk_sizegrip
A ttk::sizegrip widget (also known as a grow box) allows the user to resize the containing toplevel window by pressing and dragging the grip.
ttk_spinbox
A ttk::spinbox widget is a ttk::entry widget with built-in up and down buttons that are used to either modify a numeric value or to select among a set of...
ttk_style
Manipulate style database
ttk_treeview
The ttk::treeview widget displays a hierarchical collection of items. Each item has a textual label, an optional image, and an optional list of data values. The...
ttk_vsapi
The vsapi element factory creates a new element in the current theme whose visual appearance is drawn using the Microsoft Visual Styles API which is responsible...
ttk_widget
This manual describes common widget options and commands.
winfo
The winfo command is used to retrieve information about windows managed by Tk. It can take any of a number of different forms, depending on the option argument.
wm
The wm command is used to interact with window managers in order to control such things as the title for a window, its geometry, or the increments in terms of...