KDE Now! Logo

toolbutton widget

Usage:
toolbutton widget-path ?options?

toolbutton creates a button which mimics the KDE/Qt toolbar buttons. widget-path specifies the pathname for the new widget.

Options

-image name
specifies name as the image to appear on the button. toolbutton searches the cache of known pixmaps and bitmaps in order to find name.
-tooltip text
specifies the text for a tooltip. This option may be abbreviated to ``-tip''
-command Tcl-script
specifies the command(s) to be executed when the button is clicked.
-text text
allows a piece of text to be made part of a toolbutton.
-textposition left|right
specifies the position of text relative to the image. Defaults to ``right''
-state normal|disable
configures the initial state of the toolbutton. Disabled toolbuttons have their pixmaps recoloured to appear sunken. Note: computing the disabled shading is very compute-intensive and takes a few seconds. It will be faster using Tcl 8. However once a pixmap has been `disabled' it is cached for subsequent use by the application.

Reconfiguring toolbuttons

Toolbutton widgets support dynamic reconfiguration using widget commands. Once created, a toolbutton may have the following attributes reconfigured using the configure widget command
-image name
specifies a new pixmap image
-tooltip text
specifies new text for the tooltip.
-command Tcl-script
specifies a new command
-text text
changes the text on the button. Note: you can only reconfigure using -text if you had previously created the button with text
-state normal|disable
reconfigure the state of the toolbutton

cget widget command

Toolbuttons support the cget widget command to find the value of any of the settable options.

invoke widget command

Toolbuttons support the invoke widget command which executes the currently configured tcl-script bound to the button.
Ktk is maintained by Andrew F. Lack

This page was last updated on 15th February 1999