Class ::tycho::ToolBar


Inherits: ::tycho::TWidget - Source File - Contents: itk_options - public methods - protected methods - protected variable
A tool bar with any of a variety of widgets. It is meant to be put at the top of a Displayer.

NOTE: There is a certain amount of duplication here with the Query object, but enough differences that it is hard to see how to merge the two. The objectives are somewhat different. As facilities get added to each, we should try to at least keep the same interface.


Itk_options

-statusbar
The status bar to use for print help messages.
-font [::tycho::font
The font to use.
-padx 11
The horizontal button padding.
-pady 4
The vertical button padding.
-entryforeground black
The options used by the entry widgets.
-entrybackground white
-entryfont 8x13

Public constructs

Public Methods

button tag description args
Add a button to the toolbar at the top. The required arguments are a tag for the button and itk_component and a description. The description will appear in the status bar, if there is one, whenever the mouse is moved into the button. Any additional arguments are passed to the Tk button command. For example,
   button foo "a button" -text "Push Me" -command "::tycho::post Thanks"
will create a button with label "Push Me" and the specified command. To use a bitmap instead, something like the following will work:
   global ::TYCHO
   button foo "a button" -bitmap @$TYCHO/kernel/img/back.xbm -command ...
Note that buttons appear in the order they are added, from left to right. Someday we should add a way to put more buttons on a second row.

Note that this method shadows the Tk button command, so you must use ::button if you want the Tk version.

clear {tag {}}
If no argument is given, clear all widgets. If a tag is given as an argument, clear the corresponding widget. If the tag is not recognized, do nothing.
disable tag
Disable user interaction with the widget with the given tag.
enable tag
Enable user interaction with the widget with the given tag.
entry tag label default command args
Add an entry widget to the toolbar. The arguments are: The entry widget has a "click to focus" model. When the user types a return in the widget, the contents of the entry box are appended to the specified command, which is then invoked.
get {tag {}}
If no argument is given, get the current value of the queries, and return as a list in the form {tag value tag value ...}. This list can be directly assigned to an array using array set, making it easy to use the results of the query. If a tag is given as an argument, return the value of the corresponding entry only. If the tag is not recognized, return an empty string. For buttons, the label of the button is returned.
insert tag str
Insert the specified string into the specified entry box. If the tag is not recognized, flag an error. For button widgets, the label of the button is changed.

Protected constructs

Protected Methods

preference mode args
Access the preferences associated with this widget. By default, all widgets access the "global" preference set; many widgets will, however, need to access a different preference set, and they must indicate so by overriding this method. Here, we are overriding it to subscribe to the "dialogs" preference set.
putStatus string
Put an arbitrary string to the status bar. To enforce wrap-around, set the wrap-length of the label to its current width.

Protected Variable

numentries 0
Remember the number of entries currently in this widget.

Index of classes



Author: E. A. Lee
Version: @(#)ToolBar.itcl 1.13 12/05/96
Copyright: (c) 1996 The Regents of the University of California.