two_toolbar(n) manual page

Back to the Index
Table of Contents

Name

two_toolbar - Toolbar widget

Synopsis

package require twoToolbar ?1.0?
two_toolbar pathName ?options?

Description

two_toolbar is an implementation of a toolbar consisting of buttons, checkbuttons, radiobuttons, and combobox. Toolbars can be torn off (to make them float on top of your application). Buttons have a flat appearance, i.e. the 3D borders only appear when the mouse is over the button.

Commands

The combobox widget command takes the following commands (as the first argument):
pathName add type ?entryoptions?
Add a new entry to the toolbar. type can be any of button, checkbutton, radiobutton, cascade, combobox, separator or newline. The entry newline is the same as a separator, only in torn off state is it handled as a newline, i.e. the entries after this entry are put in the next line. The button can also be called command like in a Tk menu.
pathName entrybind index sequence script
Add a binding to button number index. This is needed as every button exists twice (in the normal toolbar and the torn-off version).
pathName entrycget index option
Like cget, but applies to button at position index. This is needed as every button exists twice (in the normal toolbar and the torn-off version).
pathName entryconfigure index ?options?
Like configure, but applies to button at position index. This is needed as every button exists twice (in the normal toolbar and the torn-off version).
pathName entrycommand index command ?options?
Apply the command and options to the currently visible incarnation of the element at index position index.
pathName tearoff TCL_BOOLEAN
Tear the toolbar off (1) or put it back in place (0).

Options

The two_toolbar command takes all options of the TK frame(n) widget plus to following options:
-tearoff TCL_BOOLEAN
Enable/disable tearoff (like menu). Defaults to 1.
-title string
Set title of torn-off toolbar to string.

Entry Options

The elements added to the toolbar take the following options (add, entrycconfigure, entrycget):
-alias string
Set string as an alais to the entry which can be used instead of the index for entry{configure|cget}.
-tip string
Adds tooltip string to this widget.
-info string
Adds string for tooltip (long) info string.
-label string
identical: set the label of a (radio/check) button.
-text string
Same as -label.
-command script
Evaluated the script (in global context) when button, checkbutton or radiobutton are pressed. The value of the variable associated with the checkbutton or radiobutton has already been updated.
-onvalue value
Set the value of a check'ed checkbutton.
-offvalue value
Set the value of an uncheck'ed checkbutton.
-value value
Set the variable associated with a set of radiobuttons to the value of this button if this button is selected.
-variable varname
varname is the name of the variable (i nglobal context) to be associated with a checkbutton or a radiobutton. This variable will represent the current state of the button (checkbutton: -onvalue/-offvalue; radiobutton: -vlaue). Changes to this variable are traced; if chaged, the state of the button(s) will be adopted, but the script (set with -command) will not be evaluated.
-menu widgetpath
Specify which menu should be used for add menu.

Elements

A two_toolbar consists of a container frame and a second frame embedded within (class: TwoToolBar, appended pathname .tb) to enable hiding it. The torn off version of the toolbar consists of a toplevel widget (class: TwoToolBar, appended pathname .top). The first element in both toolbar incarantions is the tearoff handle.

All buttons (normal, check, radio) are built using the normal Tk button with different bindings. Buttons have a flat relief and only rise on mouse over. The combobox(n) widget is provieded by this library.

As there are two versions of the toolbar (in place and torn off), there is no widget path to the elements. Configuring the entries and applying tooltips has to be done through the toolbar widget command.

Bugs

entryconfigure and entrycget don't (yet) know all options.

Author

Frank J. Leitner
frank@fjl.de

See Also

button(n) , two_combobox(n) , two_tooltip(n) .


Table of Contents


Back to the Index