Returns the value of option of BWidget path. cget tests the option
existence and takes care of synchronization with subwidget.
Typically called by the BWidget cget command.
The standard method for creating a BWidget. The real widget path
is renamed to $path:cmd, and a new proc is created to replace the
path which points to the BWidget's commands.
If rename is false, the path will not be renamed, but the
proc will still be created. This is useful when inheriting another
BWidget who will already have renamed the widget.
The command returns the widget path. This command is usually the
last command executed in the ::create command for the widget.
options is the list describing new options. Each new option is a list
{option type value ro ?args?} where:
option is the name of the option
type is the type of the option
value is the default value of the option
ro is the readonly flag of the option
args depends on type
type can be:
TkResource
value of option denotes a resource of a Tk widget. args must be class or
{class realoption}. class is the creation command of the Tk widget, e.g.
entry.
The second form must be used if option has not the same name in Tk widget,
but realoption.
If value is empty, it is initialized to the default value of the Tk widget.
BwResource
value of option denotes a resource of a BWidget. args must be class or
{class realoption}. class is the name of the namespace of the BWidget, e.g.
LabelFrame.
The second form must be used if option has not the same name in BWidget,
but realoption.
If value is empty, it is initialized to the default value of the BWidget.
Int
value of option is an integer.
args can be {?min? ?max?} to force it to be in a range. The test is
[expr $option > $min] && [expr $option < $max] so
if args is {0 10}, value must be beetween 0 and 10 exclude,
if args is {=0 =10} , value must be beetween 0 and 10 include.
Boolean
value of option is a boolean. True values can be 1, true or yes.
False values can be 0, false or no. Widget::cget always return
0 or 1.
Enum
value of option is a element of a enumeration. args must be the list
of enumeration, e.g. {top left bottom right}.
Flag
value of option is a combination of a set of chars. args must be a
string defining the set.
String
value of option is any uncontrolled string.
Synonym
option is a synonym of option args. value has no effect here.
This command is used to define a new BWidget class. It is
usually the first command executed in a new widget definition.
class is the name of the new widget class.
filename is the name of the file (without extension) in the
BWidget distribution that defines this class.
?-classonly? If present, the class is not setup.
?-namespace ns? The namespace where the widget's procedures live
in; defaults to the class name.
Each class defined after the filename is a class that this widget
depends on. The ::use command will be called for each of these
classes after the new widget has been defined.
If -classonly option is not given this command does several things to
setup the new class. First, it creates an alias in the global namespace for
the name of the class that points to the class's ::create subcommand.
Second, it defines a ::use subcommand for the class which other classes can
use to load this class on the fly. Lastly, it creates a default binding to
the <Destroy> event for the class that calls Widget::destroy on the
path. This is the default setup for almost all widgets in the BWidget
package.
Returns the value of option of BWidget path. This command does not test
option existence, does not handle synonym and does not take care of synchronization with
subwidget.
Make the variable varName relational to path accessible in
the current procedure. The variable will be created in the widget namespace
for path and can be used for storing widget-specific information.
When path is destroyed, any variable accessed in this manner will be
destroyed with it.
If myVarName is specified, the variable will be accessible in the
current procedure as that name.
Commands of this namespace enable user to define a BWidget or a Tk widget as a drop site.
A drop site is composed of the type of object that can be dropped and associated operation,
a command called when drop occurs, and a command when an object is dragged over the widget.
A drop site must have at least one type of acceptable object and a drop command.
This command provides a simple way to include options relatives to a drop site into
BWidget resources definition.
It includes the options needed for register, -dropovercmd and -dropcmd,
initialized to empty string, and -droptypes, initialized to types,
and one new option:
-dropenabled
Specifies wether or not drop is active (initialized to 0)
This command can be used to provide a dynamic drag while drag-over events.
While a drag occurs, events <Enter>, <Motion> and <Leave> are catched.
Arguments passed to the command are:
pathname of the drop target (the widget itself),
pathname of the drag source,
event over the drop target: enter, motion or leave,
root x-coordinate of the pointer,
root y-coordinate of the pointer,
operation,
type of the dragged data,
dragged data.
Command must the new status of the drag:
0 if widget refuse this drag. Command will not be recalled on motion/leave event.
1 if widget accept this drag. Command will not be recalled on motion/leave event.
2 if widget refuse this drag. Command will be recalled on each motion event to reevaluate.
3 if widget accept this drag. Command will be recalled on each motion event to reevaluate.
Here is a list of events and associated actions on a DropSite widget. This example
assumes that dragged data type is valid for the drop target.
status is the status of the drag on a DropSite. Its value is:
Event
Old status
Action
New status
<Enter>
-
if DropSite has dropovercmd, call it with enter
result of dropovercmd
else
1
<Motion>
0 or 1
unchanged
2 or 3
call dropovercmd with motion
result of dropovercmd
<Leave>
0 or 1
-
2 or 3
call dropovercmd with leave
-
<Drop>
0
call dragendcmd of drag source
-
1
call dropcmd and call dragendcmd of drag source
2
call dropovercmd with leave and call dragendcmd of drag source
Specifies a list {typeoplist ?typeoplist? ...} of acceptable
types and associated operations for the drop target.
For each type, oplist is a list
{descopsmod ?descopsmod? ...} describing operations and
modifier keys for these operations.
descops describe an operation. It can be a predefined operations (copy,
move or link) or a new user defined operation, of the form {subopbaseop ?bitmap?}.
subop is the name given to the sub operation, baseop is the name of the
base operation (copy, move or link) and bitmap is a bitmap
to display for the operation.
If bitmap is empty, the default bitmap of the base operation is used for the
sub operation.
subop can be a base operation, in order to change the bitmap of a base operation.
In this case, baseop must be empty or equal to subop.
mod is the modifer key for the operation. It can be:
none to specify that no modifier key is pressed. This modifier can only be used
with a sub operation named default (and vice versa), which has the behaviour of not
display any bitmap operation. For all type, if the modifier none is not given, it is
automatically associated to the default sub operation of a copy base operation.
program to specifies a sub operation accessible only by DropSite::setoperation.
A list combining shift, control and alt, which means their
corresponding key.
This command provides a simple way to call register during a BWidget creation or
configuration.
path is the pathname of the BWidget,
subpath is the pathname of the tk widget where drag event occurs,
dropover is a command for drag-over event,
drop is a command for drop event,
force specifies wether or not to call register whenever no option value
has changed (0 by default - for BWidget configuration, use 1 for BWidget creation).
setdrop verifies the modification flag of options dropenabled and
droptypes and calls register if needed according to the options values and
dropover and drop arguments. dropovercmd and dropcmd are not
taken from options of widget because they are considered as user command, called by
BWidget implementation of drag-over and drop events.
PanedWindow is a widget that lays out children in
a vertically or horizontally tiled format.
The user can adjust the size of the panes, with a pane control sash created
between children.
By default, the control sash is either a button or a line depending
upon the underlying operating system. This sash may be explicitly set
using this option. If set to line then the sash consists of
just a dividing line. Otherwise if set to button then it
constists of a knob that can be dragged.
Specifies how the weights specified when adding panes should be used. Must be
extra or available. When using extra, only extra space is
devided among the diffferent panes relative to their weight. When using
available, all space is devided among the diffferent panes relative to
their weight. Default value for weights is extra.
This command add a new pane. The new pane is placed below the previous pane for
vertical layout or at right for horizontal layout. This command returns a frame
where user can place its widget. Valid options are:
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
PasswdDlg provides a simple way to display a login/password dialog.
PasswdDlg::create creates the dialog, displays it, and return the value of login
and password in a list, or an empty list if it is destroyed or user press cancel.
When returning, the dialog no longer exists.
Additionnal resources can be set to modify other text:
*loginName Label for login LabelEntry
*passwordName Label for password LabelEntry
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Button widget extends the Tk button with new options.
DynamicHelp options,
a new relief style, callback for arm/disarm, and
repeatdelay/repeatinterval options has been added.
Specifies a Tcl command to associate with the Button when mouse button 1 is pressed over the
Button. When repeatdelay or repeatinterval option is positive integer,
this command is repeatedly called if mouse pointer is over the Button and until mouse
button 1 is released.
Specifies one of three states for the default ring: normal, active,
or disabled. In active state, the button is drawn with the platform specific
appearance for a default button. In normal state, the button is drawn with the platform
specific appearance for a non-default button, leaving enough space to draw the default
button appearance. The normal and active states will result in buttons of the same size.
In disabled state, the button is drawn with the non-default button appearance without
leaving space for the default appearance. The disabled state may result
in a smaller button than the active state.
Specifies a Tcl command to associate with the Button when mouse button 1 is released.
This command is called even if pointer is not over the Button, and always before
the command specified by command option.
It is typically used in conjuntion with armcommand, repeatdelay and
repeatinterval.
Specifies a desired height for the Button.
If an image or bitmap is being displayed in the Button then the value is in
screen units;
for text it is in lines of text.
If this option isn't specified, the Button's desired height is computed
from the size of the image or bitmap or text being displayed in it.
Option not available when widget is themed.
Specifies a standard name for the button. If the option *nameName is
found in the resources database, then text and underline options
are extracted from its value.
Specifies the 3-D effect desired for the widget. Acceptable values are standard values for
button relief (raised, sunken, flat, ridge, solid, and groove) and link, which specifies that button relief is flat when pointer
is outside the button and raised when pointer is inside.
This option has only the following effect if the widget is themed:
The value link used a style Toolbutton while any other value uses the standard effect.
Specifies one of three states for the Button: normal, active,
or disabled. In normal state the Button is displayed using the
foreground and background options. The active state is
typically used when the pointer is over the Button. In active state
the Button is displayed using the activeforeground and
activebackground options. Disabled state means that the Button
should be insensitive: the default bindings will refuse to activate
the widget and will ignore mouse button presses.
In this state the disabledforeground and
background options determine how the Button is displayed.
Specifies the integer index of a character to underline in the label of the button.
0 corresponds to the first character of the text displayed, 1 to the next character,
and so on.
The binding <Alt-char> is automatically set on the toplevel
of the Button to call Button::setfocus.
If an image or bitmap is being displayed in the Button then the value is in
screen units;
for text it is in characters.
If this option isn't specified, the Button's desired width is computed
from the size of the image or bitmap or text being displayed in it.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
If Button state is not disabled, this invoke the commands of the Button.
Button is redisplayed with active color and sunken relief, and
armcommand is called. Then Button is redisplayed with
normal color and its defined relief, and disarmcommand then command
are called.
invoke is called when Button has input focus and user press the space bar.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Tree widget uses canvas to display a hierarchical list of items (called nodes).
Each node is composed of a label with its own font and foreground attributes, and an optional
image or window. Each node can have a list of subnodes, which can be collapsed or expanded.
Each node is drawn in a single line, whose height is defined by the
deltay option, so they must have at most this height.
A node is uniquely identified by a string given at creation (by the
insert command). The node named root is the root of
the tree and is not drawn.
The tree structure is directly maintained by the widget.
Specifies a command to be called when drag ended.
dragendcmd must be a command conforming to the description of the
option dragendcmd of DragSite::register.
Tree has a command wrapper for drag-init events. This command refused the drag
if no node is designated. In other cases:
If draginitcmd is empty, it returns:
the value of option dragtype or TREE_NODE if empty as the data type,
{copy move link} as the operations,
the node identifier as the data.
If draginitcmd is not empty, it is called with the following arguments:
the pathname of the tree,
the identifier of the dragged node,
the toplevel created to represent dragged data.
and must return a value conforming to draginitcmd option described in
DragSite::register.
Tree has a command wrapper for drop events. This command stops auto scrolling
and extract node and position.
If dropcmd is not empty, it is called with the following arguments:
the pathname of the tree,
the pathname of the drag source,
a list describing where the drop occurs. It can be:
Tree has a command wrapper for drag-over events. This command enables auto scrolling
and position extraction during the drag-over.
If dropovercmd is not empty, the command is called with the following aguments:
the pathname of the tree,
the pathname of the drag source,
a list describing where the drop can occur, whose elements are:
the string widget if dropovertype option contains w, else empty string.
the targeted node if drag icon points a node and dropovertype option contains n, else empty string.
a list containing a node and the position within the children of the node where drag
icon points to if dropovertype option contains p, else empty string.
optionally, the preferred method if drop can occur both inside a node and between two
nodes. The value is position or node.
the current operation,
the data type,
the data.
The command must return a list with two elements:
the drop status, conforming to those described in dropovercmd option of
DropSite::register,
Specifies the type of drop-over interaction. Must be a combination of
w, which specifies that drop can occurs everywhere on widget,
p, which specifies that drop can occurs between two nodes,
and n, which specifies that drop occurs inside nodes.
Specifies a list of accepted dropped object/operation.
See option droptypes of
DropSite::register.
for more infromation.
Default is TREE_NODE with operations copy and move.
Certain special characters in node names are automatically substituted
by the tree during operation. These characters are & | ^ !.
They are all substituted with a _ character. This is only to
avoid errors because the characters are special to the tree widget.
This command associates a command to execute whenever the event
sequence given by event occurs on the image of a node.
The node idenfier on which the event occurs is appended to the command and may be used to manipulate the tree (e.g. don't use %W).
If -selectfill is given, an eventual binding of the background box by bindText is overwritten.
This command associates a command to execute whenever the event
sequence given by event occurs on the label of a node.
The node idenfier on which the event occurs is appended to the command and may be used to manipulate the tree (e.g. don't use %W).
If -selectfill is given, an eventual binding of the background box by bindImage is overwritten.
This command close all the subtree given by node. Recurse
through the tree starting at node and set open option to 0
depending on recurse. Default value of recurse is true.
Query or modify the configuration options of the widget. If no option is
specified, returns a list describing all of the available options for
pathName. If option is specified with no value, then the
command returns a list describing the one named option (this list will
be identical to the corresponding sublist of the value returned if no
option is specified). If one or more option-value pairs are
specified, then the command modifies the given widget option(s) to have the
given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Deletes all nodes (and children of them) in arg. arg can be a list
of nodes or a list of list of nodes.
To delete all the tree, do $pathName delete [$pathName nodes root].
Provides a way for the user to edit in place the label of a node. This is
possible only if node is visible (all its parents are open).
The command takes the initial text as argument and does not modify the label of the
edited node, but returns an empty string if edition is canceled, or the typed text
if edition is accepted.
When editing, the user can cancel by pressing Escape, or accept by pressing Return.
clickres specifies what to do if the user click outside the editable area.
If clickres is 0 (the default), the edition is canceled.
If clickres is 1, the edition is accepted.
In all other case, the edition continues.
If edition is accepted and modifycmd is not empty, then it is called with
the new text as argument and must return 1 to accept the new text, 0 to refuse it
and continue edition.
select specifies wether or not the initial text should be selected. Default is 1.
Returns the node given by the position findinfo.
findinfo can take the form of a pixel position @x,y or
of the line number of a currently visible Tree node. The first line
of the Tree has the value of zero.
If confine is non-empty, then confine findinfo to only
match pixel positions for the area consumed by Tree labels, not just
anywhere on their lines. (confine has no effect if
findinfo is a line number.)
Inserts a new node identified by node in the children list of
parent at position index.
Any instance of #auto within the node name will be replaced by the
number of the item in the order of insertion. The non-printable characters
\1 to \5 are reserved for internal use and should not be present in node
names.
Specifies how the cross used to expand or collapse the children of a node
should be drawn.
Must be one of auto, always or never.
If auto, the cross is drawn only if the node has children.
If always, the cross is always drawn.
If never, the cross is never drawn.
To maintain compatibility with older versions of this widget,
allways is a deprecated synonym to always.
If specified, refers to a command to execute to get the help text to display.
The command must return a string to display.
If the command returns an empty string, no help is displayed.
See also DynamicHelp.
This command is similar to the configure command, except that it applies to the
options for an individual item, whereas configure applies to the options for
the widget as a whole. Options may have any of the values accepted by the
item creation widget command. If options are specified, options are modified as indicated
in the command and the command returns an empty string. If no options are specified,
returns a list describing the current options for the item.
Read-only options are not be modified.
Returns parts of the children of node, following first and last.
If first and last are omitted, returns the list of all children.
If first is specified and last omitted, returns the child at index
first, or an empty string if first refers to a non-existent element.
If first and last are specified, the command returns a list whose elements
are all of the children between first and last,
inclusive. Both first and last may have any of the standard
forms for indices.
This command open all the subtree given by node. Recurse through the
tree starting at node and set open option to 1 depending on value
of recurse. Default value of recurse is true.
A <<TreeSelect>> virtual event is generated any time the
selection in the tree changes. This is the default behavior of an
item in the tree, but it can be overridden with the bindText or
bindImage command. If the button 1 binding is overridden, this event may
not be generated.
The tree has all the standard mouse wheel bindings when it has focus.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Specifies the window to view. This widget must have -xscrollcommand and
-yscrollcommand options, and respond to xview and yview command.
In order to make ScrollView working with other scrollbar, -xscrollcommand and
-yscrollcommand options of the widget must be set before the widget is passed to
the -window option of the ScrollView (for example, if the widget is handled by
a ScrolledWindow, call setwidget before setting -window option).
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
BINDINGS
If mouse button 1 is pressed and dragged over the ScrollView, the top left corner of
the visible area of the scrolled window is moved proportionally to the mouse displacement.
If mouse button 3 is pressed over the ScrollView, the top left corner of the visible
area is proportionally set to this point.
This manual entry describes the common configuration options supported
by widgets in the Tk toolkit. Every widget does not necessarily support
every option (see the manual entries for individual widgets for a list
of the standard options supported by that widget), but if a widget does
support an option with one of the names listed below, then the option
has exactly the effect described below.
In the descriptions below, ``Command-Line Name'' refers to the
switch used in class commands and configure widget commands to
set this value. For example, if an option's command-line switch is
-foreground and there exists a widget .a.b.c, then the
command
.a.b.c configure -foreground black
may be used to specify the value black for the option in the
the widget .a.b.c. Command-line switches may be abbreviated,
as long as the abbreviation is unambiguous.
``Database Name'' refers to the option's name in the option database (e.g.
in .Xdefaults files). ``Database Class'' refers to the option's class value
in the option database.
Specifies background color to use when drawing active elements.
An element (a widget or portion of a widget) is active if the
mouse cursor is positioned over the element and pressing a mouse button
will cause some action to occur.
If strict Motif compliance has been requested by setting the
tk_strictMotif variable, this option will normally be
ignored; the normal background color will be used instead.
For some elements on Windows and Macintosh systems, the active color
will only be used while mouse button 1 is pressed over the element.
Specifies a non-negative value indicating
the width of the 3-D border drawn around active elements. See above for
definition of active elements.
The value may have any of the forms acceptable to Tk_GetPixels.
This option is typically only available in widgets displaying more
than one element at a time (e.g. menus but not buttons).
Specifies how the information in a widget (e.g. text or a bitmap)
is to be displayed in the widget.
Must be one of the values n, ne, e, se,
s, sw, w, nw, or center.
For example, nw means display the information such that its
top-left corner is at the top-left corner of the widget.
Specifies a bitmap to display in the widget, in any of the forms
acceptable to Tk_GetBitmap.
The exact way in which the bitmap is displayed may be affected by
other options such as anchor or justify.
Typically, if this option is specified then it overrides other
options that specify a textual value to display in the widget;
the bitmap option may be reset to an empty string to re-enable
a text display.
In widgets that support both bitmap and image options,
image will usually override bitmap.
Specifies a non-negative value indicating the width
of the 3-D border to draw around the outside of the widget (if such a
border is being drawn; the relief option typically determines
this). The value may also be used when drawing 3-D effects in the
interior of the widget.
The value may have any of the forms acceptable to Tk_GetPixels.
Specifies background color to use when drawing a disabled element.
If the option is specified as an empty string (which is typically the
case on monochrome displays), disabled elements are drawn with the
normal background color but they are dimmed by drawing them
with a stippled fill pattern.
Database Name: disabledForeground
Database Class: DisabledForeground
Specifies foreground color to use when drawing a disabled element.
If the option is specified as an empty string (which is typically the
case on monochrome displays), disabled elements are drawn with the
normal foreground color but they are dimmed by drawing them
with a stippled fill pattern.
Specifies whether or not a selection in the widget should also be
the X selection.
The value may have any of the forms accepted by Tcl_GetBoolean,
such as true, false, 0, 1, yes, or no.
If the selection is exported, then selecting in the widget deselects
the current X selection, selecting outside the widget deselects any
widget selection, and the widget will respond to selection retrieval
requests when it has a selection. The default is usually for widgets
to export selections.
Specifies a non-negative value indicating the width of the highlight
rectangle to draw around the outside of the widget when it has the
input focus.
The value may have any of the forms acceptable to Tk_GetPixels.
If the value is zero, no focus highlight is drawn around the widget.
Specifies an image to display in the widget, which must have been
created with the image create command.
Typically, if the image option is specified then it overrides other
options that specify a bitmap or textual value to display in the widget;
the image option may be reset to an empty string to re-enable
a bitmap or text display.
Specifies the color to use as background in the area covered by the
insertion cursor. This color will normally override either the normal
background for the widget (or the selection background if the insertion
cursor happens to fall in the selection).
Specifies a non-negative value indicating the width
of the 3-D border to draw around the insertion cursor.
The value may have any of the forms acceptable to Tk_GetPixels.
Specifies a non-negative integer value indicating the number of
milliseconds the insertion cursor should remain ``off'' in each blink cycle.
If this option is zero then the cursor doesn't blink: it is on
all the time.
Specifies a value indicating the total width of the insertion cursor.
The value may have any of the forms acceptable to Tk_GetPixels.
If a border has been specified for the insertion
cursor (using the insertBorderWidth option), the border
will be drawn inside the width specified by the insertWidth
option.
For widgets with a slider that can be dragged to adjust a value,
such as scrollbars, this option determines when
notifications are made about changes in the value.
The option's value must be a boolean of the form accepted by
Tcl_GetBoolean.
If the value is false, updates are made continuously as the
slider is dragged.
If the value is true, updates are delayed until the mouse button
is released to end the drag; at that point a single notification
is made (the value ``jumps'' rather than changing smoothly).
When there are multiple lines of text displayed in a widget, this
option determines how the lines line up with each other.
Must be one of left, center, or right.
Left means that the lines' left edges all line up, center
means that the lines' centers are aligned, and right means
that the lines' right edges line up.
For widgets that can lay themselves out with either a horizontal
or vertical orientation, such as scrollbars, this option specifies
which orientation should be used. Must be either horizontal
or vertical or an abbreviation of one of these.
Specifies a non-negative value indicating how much extra space
to request for the widget in the X-direction.
The value may have any of the forms acceptable to Tk_GetPixels.
When computing how large a window it needs, the widget will
add this amount to the width it would normally need (as determined
by the width of the things displayed in the widget); if the geometry
manager can satisfy this request, the widget will end up with extra
internal space to the left and/or right of what it displays inside.
Most widgets only use this option for padding text: if they are
displaying a bitmap or image, then they usually ignore padding
options.
Specifies a non-negative value indicating how much extra space
to request for the widget in the Y-direction.
The value may have any of the forms acceptable to Tk_GetPixels.
When computing how large a window it needs, the widget will add
this amount to the height it would normally need (as determined by
the height of the things displayed in the widget); if the geometry
manager can satisfy this request, the widget will end up with extra
internal space above and/or below what it displays inside.
Most widgets only use this option for padding text: if they are
displaying a bitmap or image, then they usually ignore padding
options.
Specifies the 3-D effect desired for the widget. Acceptable
values are raised, sunken, flat, ridge,
solid, and groove.
The value
indicates how the interior of the widget should appear relative
to its exterior; for example, raised means the interior of
the widget should appear to protrude from the screen, relative to
the exterior of the widget.
Specifies the number of milliseconds a button or key must be held
down before it begins to auto-repeat. Used, for example, on the
up- and down-arrows in scrollbars.
Specifies a non-negative value indicating the width
of the 3-D border to draw around selected items.
The value may have any of the forms acceptable to Tk_GetPixels.
Specifies a boolean value that determines whether this widget controls the
resizing grid for its top-level window.
This option is typically used in text widgets, where the information
in the widget has a natural size (the size of a character) and it makes
sense for the window's dimensions to be integral numbers of these units.
These natural window sizes form a grid.
If the setGrid option is set to true then the widget will
communicate with the window manager so that when the user interactively
resizes the top-level window that contains the widget, the dimensions of
the window will be displayed to the user in grid units and the window
size will be constrained to integral numbers of grid units.
See the section GRIDDED GEOMETRY MANAGEMENT in the wm manual
entry for more details.
Determines whether the window accepts the focus during keyboard
traversal (e.g., Tab and Shift-Tab).
Before setting the focus to a window, the traversal scripts
consult the value of the takeFocus option.
A value of 0 means that the window should be skipped entirely
during keyboard traversal.
1 means that the window should receive the input
focus as long as it is viewable (it and all of its ancestors are mapped).
An empty value for the option means that the traversal scripts make
the decision about whether or not to focus on the window: the current
algorithm is to skip the window if it is
disabled, if it has no key bindings, or if it is not viewable.
If the value has any other form, then the traversal scripts take
the value, append the name of the window to it (with a separator space),
and evaluate the resulting string as a Tcl script.
The script must return 0, 1, or an empty string: a
0 or 1 value specifies whether the window will receive
the input focus, and an empty string results in the default decision
described above.
Note: this interpretation of the option is defined entirely by
the Tcl scripts that implement traversal: the widget implementations
ignore the option entirely, so you can change its meaning if you
redefine the keyboard traversal scripts.
Specifies a string to be displayed inside the widget. The way in which
the string is displayed depends on the particular widget and may be
determined by other options, such as anchor or justify.
Specifies the name of a variable. The value of the variable is a text
string to be displayed inside the widget; if the variable value changes
then the widget will automatically update itself to reflect the new value.
The way in which the string is displayed in the widget depends on the
particular widget and may be determined by other options, such as
anchor or justify.
Specifies the integer index of a character to underline in the widget.
This option is used by the default bindings to implement keyboard
traversal for menu buttons and menu entries.
0 corresponds to the first character of the text displayed in the
widget, 1 to the next character, and so on.
For widgets that can perform word-wrapping, this option specifies
the maximum line length.
Lines that would exceed this length are wrapped onto the next line,
so that no line is longer than the specified length.
The value may be specified in any of the standard forms for
screen distances.
If this value is less than or equal to 0 then no wrapping is done: lines
will break only at newline characters in the text.
Specifies the prefix for a command used to communicate with horizontal
scrollbars.
When the view in the widget's window changes (or
whenever anything else occurs that could change the display in a
scrollbar, such as a change in the total size of the widget's
contents), the widget will
generate a Tcl command by concatenating the scroll command and
two numbers.
Each of the numbers is a fraction between 0 and 1, which indicates
a position in the document. 0 indicates the beginning of the document,
1 indicates the end, .333 indicates a position one third the way through
the document, and so on.
The first fraction indicates the first information in the document
that is visible in the window, and the second fraction indicates
the information just after the last portion that is visible.
The command is
then passed to the Tcl interpreter for execution. Typically the
xScrollCommand option consists of the path name of a scrollbar
widget followed by ``set'', e.g. ``.x.scrollbar set'': this will cause
the scrollbar to be updated whenever the view in the window changes.
If this option is not specified, then no command will be executed.
Specifies the prefix for a command used to communicate with vertical
scrollbars. This option is treated in the same way as the
xScrollCommand option, except that it is used for vertical
scrollbars and is provided by widgets that support vertical scrolling.
See the description of xScrollCommand for details
on how this option is used.
SpinBox widget enables the user to select a value among a list given by the values
option or a set of values defined by a mininum, a maximum and an increment.
Notice that range option defines a list of values, so getvalue and
setvalue work with both values and range.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Dialog widget enables the user to create a dialog box.
Some commands take an index as argument indicating on which
Button it work. This index is the same specified for equivalent ButtonBox command:
number
Specifies the Button numerically, where 0 corresponds
to the first added Button, 1 to the next, and so on.
Specifies the anchor point of the ButtonBox.
Must be one of w, e, n, s or c.
If side option is set to top or bottom,
anchor values n, s and c have the same effect.
If side option is set to left or right,
anchor values w, e and c have the same effect.
Specifies the number of the cancel button of the Dialog. When user presses Esc or the windows close button,
this button is invoked.
If set to -1, Esc does not invoke anything.
The window close button destroys the dialog in this case and returns -1.
Specifies where to draw the Dialog toplevel relative to the dialog's
parent. Must be one of none, center, left, right,
above, below. Default value of place is center.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
This command draw the Dialog, and set grab to it following modal option.
If modal option is set to none, the command returns immediatly
an empty string. In all other case, the command returns when Dialog::enddialog
is called or when Dialog is destroyed.
The return value is the result argument of Dialog::enddialog or -1 if it is destroyed.
By default, the focus is set to the default button referenced by default option,
or to the toplevel of Dialog if no default button has been set.
If focus is present, it must be a pathname, or an index to a button.
Initial focus is set on this pathname or corresponding button.
This command is similar to the configure command, except that it applies to the
options for an individual item, whereas configure applies to the options for
the widget as a whole. Options may have any of the values accepted by the
item creation widget command. If options are specified, options are modified as indicated
in the command and the command returns an empty string. If no options are specified,
returns a list describing the current options for the item.
Read-only options are not be modified.
The Entry widget extends the default Tk entry. Options have been added to provide
visual effect depending on the state of the Entry,
DynamicHelp options,
and Drag and
Drop.
Entry behaves much like a Label, with text option to set its contents.
Tk entry command can also be used on Entry widget.
Specifies a command to be called when drag ended.
dragendcmd must be a command conforming to the description of the
option dragendcmd of DragSite::register.
If dragendcmd is empty, the internal dragend command updates the entry
following the operation (move or copy) and the dragged data
(whole or selected part of the entry).
Specifies a command to be called when dragevent occurs on widget.
draginitcmd must be a command conforming to the description of the
option draginitcmd of DragSite::register.
if draginitcmd is empty, the command refuse the drag if entry is empty or if
portion of text is selected and event doesn't occur above the selection. In all other cases,
the command returns:
as the data type, the value of option dragtype or TEXT if empty,
as the operations, {copy move} if state is normal and editable
is true, or {copy} only in other cases,
as the data, the whole content or the selected portion of the entry.
Entry has a command wrapper for drop events. This command stops auto scrolling
and extract current position.
If dropcmd is not empty, it is called with the following arguments:
the pathname of the Entry,
the pathname of the drag source,
the numeric index in the entry designated by the cursor,
the current operation,
the data type,
the data.
and must return a value conforming to dropcmd option described in
DropSite::register.
If dropcmd is empty, the wrapper updates the entry following the type of data:
COLOR or FGCOLOR
reconfigure the foreground of the Entry
BGCOLOR
reconfigure the background of the Entry
TEXT, or any other tag
reconfigure the Entry to display the associated string.
Entry has a command wrapper for drag-over events. This command enables auto scrolling
and position extraction during the drag-over.
If dropovercmd is empty, the wrapper accepts the drop if editable option is
true and state option is normal.
If dropovercmd is not empty, it is called with the following arguments:
the pathname of the Entry,
the pathname of the drag source,
the event,
the numeric index in the entry designated by the cursor,
the current operation,
the data type,
the data.
and must return a value conforming to dropovercmd option described in
DropSite::register.
Specifies a list of accepted dropped object/operation.
See option droptypes of
DropSite::register.
for more infromation.
Default accepts FGCOLOR, COLOR, BGCOLOR and TEXT,
all with copy and move operations.
If this option is specified, then the true contents of the entry are not displayed in the
window. Instead, each character in the entry's value will be displayed as the first character
in the value of this option, such as ``*''. This is useful, for example, if the entry is to
be used to enter a password. If characters in the entry are selected and copied elsewhere, the
information copied will be what is displayed, not the true contents of the entry.
Specifies one of two states for the Entry: normal or disabled.
In normal state the text of the Entry is displayed using the foreground option.
In disabled state the text of the Entry is displayed using the disabledforeground
option. If the entry is disabled then the value may not be changed by user input
and no insertion cursor will be displayed, even if the input focus is in the widget.
Disabled state is the same as not editable with visual effect.
Specifies an integer value indicating the desired width of the entry window, in average-size
characters of the widget's font. If the value is less than or equal to zero, the widget picks
a size just large enough to hold its current text.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Query or modify the configuration options of the widget. If no
option is specified, returns a list describing all of the available
options for pathName. If option is specified with no
value, then the command returns a list describing the one named
option (this list will be identical to the corresponding sublist of
the value returned if no option is specified). If one or more
option-value pairs are specified, then the command modifies the
given widget option(s) to have the given value(s); in this case the command
returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
ButtonBox layouts Button horizontally or vertically.
Some commands take an index as argument indicating on which
Button it work. This index may be specified in any of the following forms:
number
Specifies the Button numerically, where 0 corresponds
to the first added Button, 1 to the next, and so on.
Specifies the default button of the button box. The value is an integer
referencing the n-th added button, starting from 0.
If this value is -1 (the default), all button wil be drawn with their -default
option set to disabled, and this value can not be changed. If this value is
not -1, the associated button is drawn with -default option set to active and
the others are drawn with -default option set to normal. The value can be changed
by configure.
Specifies the orientation of the button box. If this option is horizontal
(the default), buttons are added from top to bottom.
If this option is vertical, buttons are added from left to right.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
This command is similar to the configure command, except that it applies to the
options for an individual item, whereas configure applies to the options for
the widget as a whole. Options may have any of the values accepted by the
item creation widget command. If options are specified, options are modified as indicated
in the command and the command returns an empty string. If no options are specified,
returns a list describing the current options for the item.
Read-only options are not be modified.
Returns a string of code that contains all the libraries needed to
use the widgets given by class. Each class's code and the
code of its dependent classes is appended to the string and returned.
This is mostly useful for saving BWidgets to another project.
Used to position and resize the widget specified by
path. w and h are used to specify the requested
width and height of the path widget for use by wm
geometry (set to 0 to use current values). The placement of the widget relative to other widgets or
the screen is controlled by additional arguments:
atxy
Place the widget specified by the path argument at screen
position x,y. See wm geometry for information about window
placement values.
center?widget?
Place the path widget centered against widget or against the
root widget if widget is not given.
left?widget?
right?widget?
Place the path widget either left or right of the
reference widget (or the root widget if widget is not
specified). If the reference widget's position is such that the newly
placed window might be obscured then the opposite side will be tried.
above?widget?
below?widget?
As for left/right above, this option causes the widget to be
placed either above or below the reference widget with the opposite
placement being attempted if the newly placed widget will not be visible.
Writes the currently used set of BWidget class code to the given
filename. All the code necessary to run the BWidgets
currently in use is written to the file. This is mostly useful
for saving BWidget code to another project as a single file instead
of the entire BWidget package.
If specified, refers to a command to execute to get the help
text to display. The command must return a string to display.
If the command returns an empty string, no help is displayed.
Specifies a variable name to which the help string will be
written. Some other widget (e.g., a status bar) is
responsible for displaying this variable.
Creating dynamic help for a menu is a two-step process. The menu
itself must first be added and then each menu entry must be added
separately. Here is a brief example.
# create menu
menu .m -type menubar
# associate menubar to toplevel BEFORE DynamicHelp::register# to make it works with menu clone name
. configure -menu .m
.m add cascade -label "File" -menu .m.file
menu .m.file
.m.file add command -label "Open..."
.m.file add command -label "Quit"
# create label for help, using variable varinfo
label .l -textvariable varinfo
# associate all entries of menu .m.file to variable varinfo
DynamicHelp::add .m.file -type menu -variable varinfo
# then declare entries of .m.file
DynamicHelp::add .m.file -type menu -index 0 -text "Detach menu"
DynamicHelp::add .m.file -type menu -index 1 -text "Open a file"
DynamicHelp::add .m.file -type menu -index 2 -text "Exit demo"
Its use is deprecated. Use DynamicHelp::add instead.
Register a help text to the widget path.
type determines the type of the help or the type of the widget.
Depending on type, other options must be provided.
type
options
balloon
?tagOrItem? text
variable
?tagOrItem? varName text
menu
varName
menuentry
index text
If one of the option is missing or is empty, help is removed for this widget.
If tagOrItem is specified, then path is a canvas or a text. In
case of a canvas, tagOrItem is the name of a tag or item on the canvas
to which the help will be bound. In case of a text, tagOrItem is the
name of a tag on the text to which the help will be bound.
For type other than balloon, varName is typically a variable
linked to a label.
For menu, balloon type help is not available. To declare a help for menu,
you first declare the menu, and then entries of this menu.
For example:
# create menu
menu .m -type menubar
# associate menubar to toplevel BEFORE DynamicHelp::register# to make it works with menu clone name
. configure -menu .m
.m add cascade -label "File" -menu .m.file
menu .m.file
.m.file add command -label "Open..."
.m.file add command -label "Quit"
# create label for help, using variable varinfo
label .l -textvariable varinfo
# associate all entries of menu .m.file to variable varinfo
DynamicHelp::register .m.file menu varinfo
# then declare entries of .m.file
DynamicHelp::register .m.file menuentry 0 "Detach menu"
DynamicHelp::register .m.file menuentry 1 "Open a file"
DynamicHelp::register .m.file menuentry 2 "Exit demo"
Notice that if popup menu is owned by a menubar, you must associate first the menubar
to its toplevel. In this case, when you create a menu popup, its clone window is also
created, and DynamicHelp::register detects the exitence of the clone window and maps
events to it.
MessageDlg provides a simple way to display a message dialog.
MessageDlg::create creates the message dialog, displays
it and return the index of the pressed button, or -1 if it is destroyed.
When returning, the dialog no longer exists.
Specifies a non-negative integer value indicating desired
aspect ratio for the text. The aspect ratio is specified as
100*width/height. 100 means the text should
be as wide as it is tall, 200 means the text should
be twice as wide as it is tall, 50 means the text should
be twice as tall as it is wide, and so on.
Used to choose line length for text if width option
isn't specified.
Defaults to 150.
The options -width and -aspect are directly heritated from the Tk message widget.
Specifies how to justify lines of text.
Must be one of left, center, or right. Defaults
to left.
This option works together with the anchor, aspect,
padx, pady, and width options to provide a variety
of arrangements of the text within the window.
The aspect and width options determine the amount of
screen space needed to display the text.
The anchor, padx, and pady options determine where this
rectangular area is displayed within the widget's window, and the
justify option determines how each line is displayed within that
rectangular region.
For example, suppose anchor is e and justify is
left, and that the message window is much larger than needed
for the text.
The the text will displayed so that the left edges of all the lines
line up and the right edge of the longest line is padx from
the right side of the window; the entire text block will be centered
in the vertical span of the window.
Specifies a string to display as the title of the message box.
If the value is empty (the default), a default title will be set corresponding
to the icon option.
The default associated title is in english, and can be modified to set it in
another language by specifying the resource:
*MessageDlg.nameTitle: value
or the equivalent tcl command:
option add *MessageDlg.nameTitle value
where name is the name of an icon as defined in the icon option.
For example, for french language, you can specify for a warning dialog:
Specifies a set of buttons to be displayed. The following values are possible:
abortretryignore
Displays three buttons whose symbolic names are abort,
retry and ignore.
ok
Displays one button whose symbolic name is ok.
okcancel
Displays two buttons whose symbolic names are ok and cancel.
retrycancel
Displays two buttons whose symbolic names are retry and cancel.
yesno
Displays two buttons whose symbolic names are yes and no.
yesnocancel
Displays three buttons whose symbolic names are yes, no
and cancel.
user
Displays buttons of -buttons option.
For any -type but user, the native Tk widget tk_messageBox is used.
In this case, only the following options are considered: -default, -icon, -message, -title and -type.
Specifies the length of lines in the window.
If this option has a value greater than zero then the aspect
option is ignored and the width option determines the line
length.
If this option has a value less than or equal to zero, then
the aspect option determines the line length.
ListBox widget uses canvas to display a list of items.
Each item is composed of a label with its own font and foreground attributes, and an optional
image or window. Each item is drawn in a single line, whose height is defined by the
deltay option, so they must have at most this height.
A item is uniquely identified by a string given at creation (by the
insert command). The ListBox can have one or more columns, depending on
multicolumn option. The user do not handle columns; the number of columns
is determined following the height of the ListBox in order to see each item vertically.
If this option is true, the listbox will take focus any time the user
clicks in it. Without focus, the listbox's mouse wheel bindings will
not work properly. The default is true.
Specifies a command to be called when drag ended.
dragendcmd must be a command conforming to the description of the
option dragendcmd of DragSite::register.
ListBox has a command wrapper for drag-init events. This command refused the drag
if no item is designated. In other cases:
If draginitcmd is empty, it returns:
the value of option dragtype or LISTBOX_ITEM if empty as the data type,
{move copy link} as the operations,
the item identifier as the data.
If draginitcmd is not empty, it is called with the following arguments:
the pathname of the listbox,
the identifier of the dragged item,
the toplevel created to represent dragged data.
and must return a value conforming to draginitcmd option described in
DragSite::register.
ListBox has a command wrapper for drop events. This command stops auto scrolling
and extract item and position.
If dropcmd is not empty, it is called with the following arguments:
the pathname of the listbox,
the pathname of the drag source,
a list describing where the drop occurs. It can be:
{widget},
{itemitem} or
{positionindex}.
the current operation,
the data type,
the data.
The default drop command allows for drag-and-drop within the listbox but
not to or from other widgets.
LsitBox has a command wrapper for drag-over events. This command enables auto scrolling
and position extraction during the drag-over.
If dropovercmd is not empty, the command is called with the following aguments:
the pathname of the listbox,
the pathname of the drag source,
a list describing where the drop can occur, whose elements are:
the string widget if dropovertype option contains w, else empty string.
the targeted item if drag icon points an item and dropovertype option contains
i, else empty string.
an index within two items where drag icon points to if dropovertype option
contains p, else empty string.
optionally, the preferred method if drop can occur both inside an item and between two
items. The value is position or item.
the current operation,
the data type,
the data.
The command must return a list with two elements:
the drop status, conforming to those described in dropovercmd option of
DropSite::register,
Specifies the type of drop-over interaction. Must be a combination of
w, which specifies that drop can occurs everywhere on widget,
p, which specifies that drop can occurs between two items,
and i, which specifies that drop occurs inside items.
Specifies a list of accepted dropped object/operation.
See option droptypes of
DropSite::register.
for more infromation.
Default is LISTBOX_ITEM with operations copy and move.
If true, the listbox will draw a selection rectangle that fills the
listbox from left-to-right instead of just drawing a box around the
selected item. This more closely mimics the standard Tk listbox.
Specifies the desired selection-mode for the listbox. Must be one of
none, single or multiple. selectmodesingle
allows to select 1 item by its text or image. selectmodemultiple
allows to select multiple items by their text or image. For more info on
selectmodes single or multiple, see the Tk listbox
command. Default value for selectmode is none.
This command associates a command to execute whenever the event
sequence given by event occurs on the image of a item.
The item idenfier on which the event occurs is appended to the command.
Any occurrence of %W in script is substituted with the
path of the listbox.
This command associates a command to execute whenever the event
sequence given by event occurs on the label of a item.
The item idenfier on which the event occurs is appended to the command.
Any occurrence of %W in script is substituted with the
path of the listbox.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Provides a way for the user to edit in place the label of an item.
The command takes the initial text as argument and does not modify the label of the
edited node, but returns an empty string if edition is canceled, or the typed text
if edition is accepted.
When editing, the user can cancel by pressing Escape, or accept by pressing Return.
clickres specifies what to do if the user click outside the editable area.
If clickres is 0 (the default), the edition is canceled.
If clickres is 1, the edition is accepted.
In all other case, the edition continues.
If edition is accepted and modifycmd is not empty, then it is called with
the new text as argument and must return 1 to accept the new text, 0 to refuse it
and continue edition.
select specifies wether or not the initial text should be selected. Default is 1.
Its use is deprecated. Use items instead.
If last is omitted, returns the item at index first in the list,
or an empty string if first refers to a non-existent element.
If last is specified, the command returns a list whose elements are all
of the items between first and last, inclusive.
Both first and last may have any of the standard forms for indices.
This command is similar to the configure command, except that it applies to the
options for an individual item, whereas configure applies to the options for
the widget as a whole. Options may have any of the values accepted by the
item creation widget command. If options are specified, options are modified as indicated
in the command and the command returns an empty string. If no options are specified,
returns a list describing the current options for the item.
Read-only options are not be modified.
If first and last are omitted, returns the list of all items.
If first is specified and last omitted, returns the item at index
first, or an empty string if first refers to a non-existent element.
If first and last are specified, the command returns a list whose elements
are all of the items between first and last,
inclusive. Both first and last may have any of the standard
forms for indices.
Specifies the desired height for the user frame in any of the forms acceptable to
Tk_GetPixels. If this option is less than or equal to zero (the default) then the window
will not request any size at all.
This option describes the menu. This is a list whose each five elements describe
one cascade menu. It has the following form:
{menunametagsmenuIdtearoffmenuentries...}
where menuentries is a list where each element describe one menu entry, which can be:
for a separator:
{separator}
for a command:
{commandmenuname ?tags? ?description? ?accelerator? ?optionvalue? ...}
for a check button:
{checkbuttonmenuname ?tags? ?description? ?accelerator? ?optionvalue? ...}
for a radio button:
{radiobuttonmenuname ?tags? ?description? ?accelerator ?optionvalue? ...}
for a cascade menu:
{cascademenunametagsmenuIdtearoffmenuentries}
where:
menuname is the name of the menu. If it contains a &, the following character
is automatically converted to the corresponding -underline option of menu add
command.
tags is the tags list for the entry, used for enabling or disabling menu
entries with MainFrame::setmenustate.
menuId is an id for the menu, from which you can get menu pathname with
MainFrame::getmenu.
accelerator specifies a key sequence. It is a list of two elements, where the first
is one of Shift, Ctrl, Alt, CtrlAlt, Cmd, or ShiftCmd, and the second as letter
(see -casesensitive option for interpretation), digit or
a special key name.
An accelerator string is build and corresponding binding set on the toplevel to invoke the
menu entry.
option value specifies additionnal options for the entry (see menu add
command).
Each value enclosed by ? are optional and defaulted to empty string, but must be
provided if one or more following options is not empty.
Example:
set descmenu {
"&File" {} {} 0 {
{command "&New" {} "Create a new document" {Ctrl n} -command Menu::new}
{command "&Open..." {} "Open an existing document" {Ctrl o} -command Menu::open}
{command "&Save" open "Save the document" {Ctrl s} -command Menu::save}
{cascade "&Export" {} export 0 {
{command "Format &1" open "Export document to format 1" {} -command {Menu::export 1}}
{command "Format &2" open "Export document to format 2" {} -command {Menu::export 2}}
}}
{separator}
{cascade "&Recent files" {} recent 0 {}}
{separator}
{command "E&xit" {} "Exit the application" {} -command Menu::exit}
}
"&Options" {} {} 0 {
{checkbutton "Toolbar" {} "Show/hide toolbar" {}
-variable Menu::_drawtoolbar
-command {$Menu::_mainframe showtoolbar toolbar $Menu::_drawtoolbar}
}
}
}
Specifies if separator should be drawn at the top and/or at the bottom of the user window.
Must be one of the values none, top, bottom or both.
It depends on the relief of subwidgets of user window.
Specifies the textvariable option for the label of the status bar.
DynamicHelp description
of menu entries are mapped to this variable at the creation of the MainFrame.
If this variable is changed by MainFrame::configure, menu description will
not be available.
You change the text of the label by modifying the value of the variable.
Specifies the desired width for the user frame in any of the forms acceptable to
Tk_GetPixels. If this option is less than or equal to zero (the default) then the window
will not request any size at all.
Add an indicator box at the right of the status bar. Each indicator are added from left
to right. An indicator is a Tk label widget configured with option-value pair
given by ?arg...?. -relief and -borderwidth options are respetively
defaulted to sunken and 1. Returns the pathname of the created label.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Set the -state option value of all the menu entries that have the tag tag
to state.
A menu entry is disabled, if one of its associated tags have state disabled.
name is one of none, status or progression.
Use none to hide the status bar, status to display the label only, or
progression to display the label and the
ProgressBar.
Hide if bool is 0, or show if bool is 1 the indexth added toolbar.
To prevent your toplevel from resizing while hiding/showing toolbar,
do [wm geometry $top [wm geometry $top]] when it is managed.
Specifies the initial color used in the widget's color selectors. When modifying a
color that is used in the GUI, the value supplied is typically the existing value of
that color.
Specifies a command to be evaluated, with a color value appended, whenever
the color selected in the dialog changes. This facility can be used to modify
a color in the calling GUI and preview the change before deciding whether or not
to accept it. If the user selects "Cancel" in the dialog, the command is called
a final time to restore the initial color (supplied by option -color) that was
used before the dialog was opened.
This option takes a Boolean value. If the value is Boolean true, the SelectColor
dialog will include a balloon help for text entry and mouse operation.
Where to place the popup color dialog when displaying it.
Must be any of: at, center, left,
right, above, or below. If -parent is specified,
placement will be in relation to the parent widget.
Specifies the type of the SelectColor widget. Must be dialog or
popup. If type option is dialog,
SelectColor::create directly creates the dialog, displays it and
return an empty string if cancel button is pressed or if dialog is destroyed,
and the selected color if ok button is pressed. In all cases, dialog is
destroyed. If type option is popup,
SelectColor::create creates a small, popup dialog with a small set of
predefined colors and a button to activate a full color dialog.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
SelectFont provides a simple way to choose font. It can be displayed
as a dialog box or as a toolbar.
Textual items in Dialog box uses -name options so they
can be translated to any language. Symbolic name used are
ok, cancel, font, size, style,
bold, italic, underline and overstrike.
Specifies the type of the SelectFont widget. Must be dialog or toolbar.
If type option is dialog, SelectFont::create directly creates the
dialog, displays it and return an empty string if cancel button is
pressed or if dialog is destroyed, and the selected font (and color
if initialcolor) if ok button is pressed. In all cases, dialog
is destroyed.
If type option is toolbar, SelectFont::create returns the pathname
of the widget created.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
ScrolledWindow enables user to create easily a widget with its scrollbar.
Scrollbars are created by ScrolledWindow and scroll commands are automatically associated to
a scrollable widget with ScrolledWindow::setwidget.
If true, scrollbar are managed during creation, so their size are included in the requested size of the
ScrolledWindow. If false, they are not.
Default value: true.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Return the pathname of the frame where the scrolled widget should be created. This command
is no longer needed. You can directly create the scrolled widget as the child
of pathName.
Associate widget to the the scrollbars. widget becomes
managed by the ScrolledWindow. The user should not attempt to manage
widget until it is no longer managed by the ScrolledWindow.
widget must be a scrollable widget, i.e. have the options
xscrollcommand/yscrollcommand and the command xview/yview,
such as canvas or text.
ProgressDlg provides a simple way to display a progress indicator dialog.
ProgressDlg::create creates the dialog, displays it, set a local
grab to it and immediatly return. The dialog is updated by modifying the
value of the variable of options -textvariable and -variable.
You have to destroy the dialog after use.
Specifies a command to call when user press stop button. Note that it
is the program's responsibility to periodically call update so
that button press events can be generated.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Specifies the type of the ProgressBar. Must be one of normal,
incremental, infinite or nonincremental_infinite.
If type is normal, the progress indicator is drawn
proportional to the variable value and maximum option each time the
variable is set.
If type is incremental, the value of the progress
indicator is maintained internally, and incremented each time the variable is
set by its value. The progress indicator is drawn proportional to the internal
value and
maximum option.
If type is infinite, the value of the progress indicator
is maintained internally, and incremented each time the variable is set by its
value. The progress indicator moves from left to right if internal value
(modulo maximum) is less than maximum/2, and from right to left
if internal value is greater than maximum/2.
If type is nonincremental_infinite, the value of the
progress indicator taken from the variable value, The progress indicator moves
from left to right if variable value (modulo maximum) is less than
maximum/2, and from right to left if internal value is greater than
maximum/2.
See -variable option for special case of its value,
Specifies the variable attached to the progress indicator. Progress indicator
is updated when the value of the variable changes. If the value of the
variable is negative, the progress indicator is not displayed (it is drawn flat
with background color - usefull for ProgressDlg to make it
invisible). If its value 0, progress indicator is reinitialized.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
ComboBox widget enables the user to select a value among a list given by
the values option. The list of possible values can be popped by
pressing the ArrowButton or by clicking in the entry when editable
value of the ComboBox is false. If editable value of the
ComboBox is true and the entry has the focus, the user can press the
top and bottom arrow keys to modify its value. If the current value exactly
match a value in the list, then the previous (for top arrow key) or then
next (for bottom arrow key) value in the list is displayed. If the current
value match the beginning of a value in the list, then this value is
displayed. If the current value doesnt match anything, then the first
value is displayed.
Specifies whether or not the combobox should attempt to auto-complete
the value in the entry field as the user types. If true, the combobox
will fill in a value that it finds in its value list as the user types
into the entry.
Specifies whether or not the combobox should post the drop down as
the user types. If true, the combobox will post and scroll to the
entry that most closely matches the user entry.
Specifies that the combobox should use a BWidget listbox in its drop
down instead of the standard Tk option. This option is enabled by
default if the -images option is not empty.
Specifies the value expansion behavior for the window. It must be
none (default) or tab. If tab is specified, then
a Tab binding is added to attempt to expand the current value based on
the other values in -values.
Specifies the desired height for the window, in lines. If zero or less,
then the desired height for the window is made just large enough to hold
all the elements in the listbox.
A list of images that correspond to the -values option. Each
image will be drawn next to its value in the drop down. This option
enables the -bwlistbox by default as it is needed to display
images.
Query or modify the configuration options of the widget. If no
option is specified, returns a list describing all of the available
options for pathName. If option is specified with no
value, then the command returns a list describing the one named
option (this list will be identical to the corresponding sublist of
the value returned if no option is specified). If one or more
option-value pairs are specified, then the command modifies the
given widget option(s) to have the given value(s); in this case the command
returns an empty string. Option may have any of the values accepted
by the creation command. Read-only options are not be modified.
When Entry of the ComboBox has the input focus, it has the following bindings, in addition
to the default Entry bindings:
Page up set the value of the ComboBox to the first value.
Page down set the value of the ComboBox to the last value.
Arrow up set the value of the ComboBox to the previous value.
Arrow down set the value of the ComboBox to the next value.
If -autopost is enabled, Escape unposts the listbox.
If the listbox is not mapped and ComboBox is not editable or disabled,
mouse button 1 on the Entry cause the listbox to popup, as if the user press the ArrowButton.
bwidget-1.9.14/BWman/NoteBook.html 0000644 0000765 0000144 00000033305 13571542357 016057 0 ustar oehhar users
NoteBook
The NoteBook widget manages a set of pages and displays one of them. A page
is a frame or ttk::frame that is included in the NoteBook by its
insert command. Each page is associated with a tab;
the tabs are displayed in a band either above or below the pages, depending on
the value of the option -side.
Specifies the amount of rounding effect at the corners of a tab. This value
can be adjusted from 0 to 8 pixels with the default being 2 pixels. Usually,
small values are preferable.
Specifies the desired height for the pages. If this option is equal to zero (the default)
then the window will not request any size at all.
In this case, user may want to call NoteBook::compute_size to make NoteBook larger
enough to contains the largest page.
Specifies the amount of bevel the tabs should have. This value can be adjusted from
0 to 8 pixels with the default being 0 pixels. A zero pixel bevel is essentially rectangular
while non-zero bevel size will look trapezoidal.
Specifies the padding between the text in the tab and the top and bottom
of the tab. Padding may be a list of two values to specify padding for
top and bottom separately. Padding defaults to {0 6}.
Specifies the desired width for the pages. If this option is equal to zero (the default)
then the window will not request any size at all.
In this case, user may want to call NoteBook::compute_size to make NoteBook larger
enough to contains the largest page.
This command associates a command to execute whenever the event
sequence given by event occurs on a tab. The page identifier on which
the event occurs is appended to the command.
This command can be called to make the NoteBook large enough to contain the largest page.
Note that if all pages use -createcmd, they will have no requested size.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Deletes the page page. If destroyframe is 1 (the default), the frame
associated to page is destroyed. If destroyframe is 0, the frame is not
destroyed and is reused by further call to insert with the same page.
Insert a new page identified by page at position index in the pages list.
index must be numeric or end. The pathname of the new page is returned.
Dynamic help, if it is specified by the options, is
displayed when the pointer hovers over the tab that belongs to the page.
Specifies a command to be evaluated, with two arguments appended, when the
image shown on the right of the tab is clicked. The first appended argument
is the Tk window path of the NoteBook, the second is the name of the page.
This command is similar to the configure command, except that it applies to the
options for an individual item, whereas configure applies to the options for
the widget as a whole. Options may have any of the values accepted by the
item creation widget command. If options are specified, options are modified as indicated
in the command and the command returns an empty string. If no options are specified,
returns a list describing the current options for the item.
Read-only options are not be modified.
Its use is deprecated. Use pages instead.
If last is omitted, returns the page at index first, or an empty string if
first refers to a non-existent element. If last is specified, the command
returns a list whose elements are all of the pages between first and last,
inclusive. Both first and last may have any of the standard
forms for indices.
If first and last are omitted, returns the list of all pages.
If first is specified and last omitted, returns the page at index
first, or an empty string if first refers to a non-existent element.
If first and last are specified, the command returns a list whose elements
are all of the pages between first and last,
inclusive. Both first and last may have any of the standard
forms for indices.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Arrange scrollable area to make widget visible in the window.
vert and horz specify which part of widget must be preferably
visible, in case where widget is too tall or too large to be entirely visible.
vert must be top (the default) or bottom,
and horz must be left (the default) or right.
If vert or horz is not a valid value, area is not scrolled in this direction.
PagesManager widget manages a set of pages and displays one of them.
PagesManager does not provide any user access method, as NoteBook
does, so it can be done through a listbox, a menu, radiobutton, or
whatever. The widget shows no pages during creation; there must be an
explicit call to raise to display one.
Specifies the desired height for the pages. If this option is equal to zero (the default)
then the window will not request any size at all.
In this case, user may want to call PagesManager::compute_size to make PagesManager
larger enough to contains the largest page.
Specifies the desired width for the pages. If this option is equal to zero (the default)
then the window will not request any size at all.
In this case, user may want to call PagesManager::compute_size to make PagesManager
larger enough to contains the largest page.
Add a new page identified by page, which is an arbitrary
identifier. The pathname of the new page is returned and widgets for
the page should be created with this as the parent or ancestor.
However, PagesManager manages its own geometry. pack,
grid or an equivalent should not be used with the pathname
returned by add.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
Its use is deprecated. Use pages instead.
If last is omitted, returns the page at index first, or an empty string if
first refers to a non-existent element. If last is specified, the command
returns a list whose elements are all of the pages between first and last,
inclusive. Both first and last may have any of the standard
forms for indices.
If first and last are omitted, returns the list of all pages.
If first is specified and last omitted, returns the page at index
first, or an empty string if first refers to a non-existent element.
If first and last are specified, the command returns a list whose elements
are all of the pages between first and last,
inclusive. Both first and last may have any of the standard
forms for indices.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.
The Label widget extends the default Tk label. Options have been added to provide
visual effect depending on the state of the Label, DynamicHelp options, and Drag
and Drop.
Specifies a command to be called when drag ended.
dragendcmd must be a command conforming to the description of the
option dragendcmd of DragSite::register.
Specifies a command to be called when dragevent occurs on widget.
draginitcmd must be a command conforming to the description of the
option draginitcmd of DragSite::register.
If draginitcmd is empty, the internal draginitcmd command is used instead
and returns:
IMAGE {copy} <image name>
if an image is displayed.
BITMAP {copy} <bitmap name>
if a bitmap is displayed.
TEXT {copy} <text>
if a text is displayed.
Note that if dragtype option is not empty, its value is used instead of those above.
Specifies a command to be called when drop occurs on the widget.
dropcmd must be a command conforming to the description of the
option dropcmd of DropSite::register.
If dropcmd is empty, the command updates the label following the type of the data:
COLOR or FGCOLOR
reconfigure the foreground of the Label.
BGCOLOR
reconfigure the background of the Label.
IMAGE
reconfigure the Label to display the associated image.
BITMAP
reconfigure the Label to display the associated bitmap.
image option is set to empty.
TEXT, or any other tag
reconfigure the Label to display the associated string.
image and bitmap options are set to empty.
Specifies a command to be called when drag icon is over the widget.
dropovercmd must be a command conforming to the description of the
option dropovercmd of DropSite::register.
If dropovercmd is empty, Label always accepts the drop if data type is
FGCOLOR, COLOR, BGCOLOR, and accepts all other data type only if
state is normal.
Specifies a list of accepted dropped object/operation.
See option droptypes of
DropSite::register.
for more infromation.
Default accepts FGCOLOR, COLOR, BGCOLOR, TEXT, BITMAP
and IMAGE, all with copy and move operations.
Specifies a desired height for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units, for text it is in lines of text.
If this option isn't specified, the label's desired height is computed
from the size of the image or bitmap or text being displayed in it.
Option not available for themed widgets.
Specifies a standard name for the label. If the option *nameName is
found in the resource database, then text and underline options
are extracted from its value.
Specifies one of two states for the Label: normal or disabled.
In normal state the text of the Label is displayed using the foreground option.
In disabled state the text of the Label is displayed using the disabledforeground option.
Specifies the integer index of a character to underline in the label.
0 corresponds to the first character of the text displayed, 1 to the next character,
and so on.
The binding <Alt-char> is automatically set on the toplevel
of the Label to call Label::setfocus.
Specifies a desired width for the label.
If an image or bitmap is being displayed in the label then the value is in
screen units, for text it is in characters.
If this option isn't specified, the label's desired width is computed
from the size of the image or bitmap or text being displayed in it.
Query or modify the configuration options of the widget. If no option is specified,
returns a list describing all of the available options for pathName.
If option is specified with no value, then the command returns a list
describing the one named option (this list will be identical to the corresponding
sublist of the value returned if no option is specified). If one or
more option-value pairs are specified, then the command modifies the given widget
option(s) to have the given value(s); in this case the command returns an empty string.
Option may have any of the values accepted by the creation command.
Read-only options are not be modified.