O'Reilly logo

Tcl/Tk in a Nutshell by Paul Raines, Jeff Tranter

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

tk_

tk_bisquetk_chooseColor [option value...]tk_dialog topw title text bitmap default string [string...]tk_focusNext windowtk_focusPrev windowtk_focusFollowsMouse windowtk_getOpenFile [option value...]tk_getSaveFile [option value...]tk_messageBox [option value...]tk_optionMenu window varName value [value...]tk_ popup menu x y [entry]tk_setPalette colortk_setPalette name color [name color...]

Each of these commands is a Tcl procedure defined at runtime in the Tk script library. The tk_bisque procedure sets the default color scheme to the light brown (''bisque'') scheme used by Tk 3.6 and earlier versions. The tk_setPalette procedure called with a single argument color sets the default color scheme to a computed one based on color as the default background color. The tk_setPalette can be called with one or more name-color pairs to set specific colors for the default color scheme. The possible values for name are:

activeBackground

activeForeground

background

disabledForeground

foreground

highlightBackground

highlightColor

insertBackground

selectColor

selectBackground

selectForeground

troughColor

The tk_getOpenFile procedure posts a modal dialog for choosing an existing filename. The tk_getSaveFile procedure does the same but does not require the chosen file to exist. In fact, if an existing file is chosen, a separate dialog box prompts for confirmation. Both procedures return the full pathname of the chosen file, or the empty string if the user cancels the operation. The available options for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required