+
+ArrowButton can be of two types following type option:
+for button type, it is standard button with an arrow drawn on it;
+for arrow type, it is an arrow like scrollbar's arrow.
+
+
+Specifies a Tcl command to associate with the ArrowButton when mouse button 1 is pressed
+over the ArrowButton. 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 a level of quality, between 0 and 2, for the arrow.
+If 0, the arrow is drawn with its maximum width and height.
+If 1, the base of arrow is arranged to be odd to have same edges.
+If 2, the base of arrow is arranged to be odd and the orthogonal to be (base+1)/2 to
+have 'straight' diagonal for edges.
+
+
+Specifies a Tcl command to associate with the ArrowButton. This command
+is typically invoked when mouse button 1 is released over the ArrowButton
+window.
+
+
+Specifies a Tcl command to associate with the ArrowButton when mouse button 1 is released.
+This command is called even if pointer is not over the ArrowButton, and always before
+the command specified by command option.
+It is typically used in conjuntion with armcommand, repeatdelay and
+repeatinterval.
+
+
+Specifies one of three states for the ArrowButton: normal, active,
+or disabled.
+
If ArrowButton type is button:
+
In normal state the ArrowButton is displayed using the
+foreground and background options. The active state is
+typically used when the pointer is over the ArrowButton. In active state
+the ArrowButton is displayed using the activeforeground and
+activebackground options. In disabled state the disabledforeground and
+background options determine how the ArrowButton is displayed.
+
+
If ArrowButton type is arrow:
+
Only colors of arrow change. The background of ArrowButton is always
+displayed using troughcolor option.
+In normal state the ArrowButton is displayed using the background option. The active
+state is typically used when the pointer is over the ArrowButton. In active state
+the ArrowButton is displayed using the activebackground option. In disabled state
+the ArrowButton is displayed with a dark stipple.
+
+
+Disabled state means that the ArrowButton
+should be insensitive: the default bindings will refuse to activate
+the widget and will ignore mouse button presses.
+
+
+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 ArrowButton state is not disabled, this invoke the commands of the button.
+ArrowButton is redisplayed with active color and sunken relief, and
+armcommand is called. Then ArrowButton is redisplayed with
+normal color and its defined relief, and disarmcommand then command
+are called.
+
invoke is called when ArrowButton has input focus and user press the space bar.
+
+
+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.
+
+
+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.
+
+
+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.
+
+
+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.
+
+
+
+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 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.
+
+
+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 text of the ComboBox to the value indicated by index in the list of values.
+index may be specified in any of the following forms:
+
+
+
+last
+
+Specifies the last element of the list of values.
+
first
+
+Specifies the first element of the list of values.
+
+next
+
+Specifies the element following the current (ie returned by getvalue) in the list
+of values.
+
previous
+
+Specifies the element preceding the current (ie returned by getvalue) in the list
+of values.
+
+@number
+
+Specifies the integer index in the list of values.
+
+
+
+ BINDINGS
+
+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 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.
+
+
ADDED BWman/Dialog.html
Index: BWman/Dialog.html
==================================================================
--- /dev/null
+++ BWman/Dialog.html
@@ -0,0 +1,293 @@
+
+Dialog
+
+
+
+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.
+
+
+
+Add a button to the button box of the dialog box. Default -command option is
+Dialog::enddialog $path index where index is number of button added.
+
+
+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.
+
+
+
+This command provides a simple way to include options relatives to a drag site into
+BWidget resources definition.
+It includes the options needed for register: -dragevent, initialized to
+event, -draginitcmd and -dragendcmd, initialized to empty string,
+and two new options:
+
+
-dragenabled
Specifies wether or not drag is active (initialized to 0)
+
-dragtype
Default or alternate dragged data type (initialized to type)
+
+
+Command called when drag initiates. When the event of option dragevent occurs on
+path, this command is called with the following arguments:
+
+
pathname of the drag source (path),
+
root x-coordinate of pointer,
+
root y-coordinate of pointer,
+
a toplevel created to represent dragged data. When returning, if it
+has no children, a bitmap is automatically displayed.
+
+The command must return a list containing three elements:
+
+
the type of the data,
+
the list of acceptable basic operations (copy, move and link)
+
and the data.
+
+Note that even if copy does not appear in the list of basic operation,
+it is considered as an acceptable operation, since copy semantic does not modify
+the drag source.
+
+
+
+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,
+
initcmd BWidget command for drag-init event,
+
endcmd BWidget command for drag-end 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).
+
+setdrag verifies the modification flag of options dragenabled and
+dragevent and calls register if needed according to the options values and
+initcmd and endcmd arguments. draginitcmd and dragendcmd are not
+taken from options of widget because they are considered as user command, called by
+BWidget implementation of drag-init and drag-end events.
+
+
+
+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 is called when user release the drag icon over a valid drop target widget.
+It takes the same arguments as -dragovercmd command. Its return values is passed
+as a result to the -dragendcmd command of the drag source widget.
+
+
+
+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 {subop
+baseop ?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.
+
+
+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
text
+
variable
varName text
+
menu
varName
+
menuentry
index text
+
+ If one of the option is missing or is empty, help is removed for this widget.
+ 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.
+
+
+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.
+
+
+
+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.
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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:
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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 cascad 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 cascad menu:
+ {cascadmenunametagsmenuIdtearoffmenuentries}
+
+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 Ctrl, Alt or CtrlAlt, and the second as letter or a digit.
+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:
+
+
+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.
+
+
+
+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.
+
+
+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.
+
+
+
+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 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.
+
+
+
+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 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 tabs. The page idenfier 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 idendified by page at position index in the pages list.
+index must be numeric or end. The pathname of the new page is returned.
+
+
+
+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.
+
+
+
+PagesManager widget manage 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.
+
+
+
+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.
+
+
+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.
+
+
+
+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.
+
+
+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.
+
+
+
+Specifies the type of the ProgressBar. Must be one of normal, incremental or
+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 grow 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.
+ 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.
+
+
+
+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.
+
+
+
+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.
+
+
+Specifies the height for the scrollable area. If zero, then the height
+of the scrollable area is made just large enough to hold all its children.
+
+
+Specifies the width for the scrollable area. If zero, then the width
+of the scrollable area window is made just large enough to hold all its children.
+
+
+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.
+
+
+
+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.
+
+
+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 is packed
+in with option expand to yes and fill to both.
+widget must be a scrollable widget, i.e. have the options
+xscrollcommand/yscrollcommand and the command xview/yview,
+such as canvas or text.
+
+
+Specifies the type of the SelectColor widget. Must be dialog or menubutton.
+ 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 menubutton, SelectColor::create returns the
+pathname of the widget created. It is composed of a button from which user can access a menu
+displaying predefined colors.
+
+
+
+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 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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+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.
+
+
+
+Specifies how the cross used to expand or collapse the children of a node
+should be drawn.
+Must be one of auto, allways or never.
+ If auto, the cross is drawn only if the node has children.
+If allways, the cross is always drawn.
+If never, the cross is never drawn.
+
+
+
+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.
+
+
Widget::syncoptions
+ class
+ subclass
+ subpath
+ options
+
+
Widget::tkinclude
+ class
+ tkwidget
+ subpath
+ ?arg...?
+
+
+
+DESCRIPTION
+
+
+The Widget namespace handle data associated to all BWidget and provide commands
+to easily define BWidget.
+ For commands can be used to define a BWidget:
+tkinclude, bwinclude, declare, addmap and syncoptions.
+Here is the definition of ComboBox widget:
+
+
+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.
+
+
+
+This command declare new resources for a BWidget.
+
+
class is class of the new 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.
+
+
+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.
+
+
+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 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.
+
+
+
ADDED CHANGES.txt
Index: CHANGES.txt
==================================================================
--- /dev/null
+++ CHANGES.txt
@@ -0,0 +1,266 @@
+____________________________________________________________
+BWidget 1.2.1 (07/09/1999)
+
+CHANGES FROM 1.2 TO 1.2.1
+
+ This version is the first patch of 1.2. It does not introduce
+ incompatibilites.
+ This patch include some new requested features, that I think
+ can't wait for 1.3:
+ - special menu handling (see MainFrame)
+ - tabs bindings in NoteBook
+ - label alignment of LabelFrame
+ - -repeatdelay and -repeatinterval options on SpinBox
+
+
+* Entry
+ - event added to tag BwDisabledEntry
+ - fixed bug when -textvariable use a variable containing space
+
+* MainFrame
+ - fixed bug when -textvariable use a variable containing space
+ - menubar entry creation modified to use the menuid as the
+ subpathname to permit special menu (help, system, apple)
+
+* LabelFrame
+ - LabelFrame::align command added
+
+* ScrollableFrame
+ - fixed typo bug
+
+* PagesManager
+ - fixed bug of window size
+ - 'pages' modified to optionally include first and last indices.
+ ('page' is still available but deprecated)
+
+* NoteBook
+ - new command 'bindtabs'
+ - fixed bug in handling result of -leavecmd command
+ - 'pages' modified to optionally include first and last indices.
+ ('page' is still available but deprecated)
+
+* ComboBox
+ - little border added around the popdown list, which appeared
+ to have no border under windows when popped above a widget
+ with the same background color.
+
+* SpinBox
+ - options -repeatdelay and -repeatinterval added.
+
+* Tree
+ - fixed strange behaviour when editing: 'selection range'
+ replaced by 'selection from'/'selection to'
+ - widget is redrawn if needed in 'edit' and 'see'
+ - fixed bug in see
+ - nodes modified to optionally include first and last indices.
+ - _subdelete modified to iterative method
+
+* ListBox
+ - fixed strange behaviour when editing: 'selection range'
+ replaced by 'selection from'/'selection to'
+ - ListBox is redrawn if needed in 'edit' and 'see'
+ - fixed bug in see
+ - 'items' modified to optionally include first and last indices.
+ ('item' is still available but deprecated)
+
+* SelectColor
+ - fixed bug in call to GlobalVar::trace renamed GlobalVar::tracevar
+
+* DragSite and DropSite
+ - fixed bug introduced by new button event.
+
+* DynamicHelp
+ - restored version of 1.1, due to the bug under windows
+
+* BWidget::place
+ - fixed bug when x or y is 0.
+
+* es.rc resource file included
+
+
+____________________________________________________________
+BWidget 1.2 (05/21/1999)
+
+CHANGES FROM 1.1 TO 1.2
+
+
+* 4 new widget:
+ - ScrollableFrame
+ - ScrollView
+ - PagesManager
+ - PasswdDlg (contributed by Stephane Lavirotte)
+
+* Widget:
+ - Flag option type added
+ - option resource database read while widget creation,
+ not while widget class creation.
+ - better handling of BWidget definition using another BWidget as a top pathname.
+
+* MainFrame
+ - more options included for ProgressBar
+ (INCOMPATIBILITY: option -variable renamed -progressvar)
+ - -menu option modified to have tags on entries and menu id on cascad menu
+ (INCOMPATIBILITY of option -menu)
+ - new command: getmenu
+ - new command: setmenustate
+
+* DropSite
+ - operations completly reworked
+ - option -droptypes modified (INCOMPATIBILITY)
+ - return code of -dropovercmd modified
+ bit 'ok' and bit 'recall' reverted
+ (INCOMPATIBILITY in -dropovercmd command)
+ - new command: setoperation
+
+* DragSite:
+ - Drag now initiates while followed by of
+ 4 pixels, so it is possible to have a event and
+ drag event on the same button.
+ - -dragevent option modified: must be the number of the button: 1, 2 or 3
+ Option is now defaulted to 1, but Entry widget keep it to 3.
+ (INCOMPATIBILITY)
+ - return result of -draginitcmd modified (INCOMPATIBILITY)
+
+* ListBox:
+ - edit command improved.
+ new arguments: initial text, and command to verify the text before accept it.
+ (INCOMPATIBILITY in call to edit)
+ - Drag and Drop modified
+ (INCOMPATIBILITY in -dropovercmd command)
+ - new command: reorder
+
+* Tree:
+ - edit command improved.
+ new arguments: initial text, and command to verify the text before accept it.
+ (INCOMPATIBILITY in call to edit)
+ - Drag and Drop modified
+ (INCOMPATIBILITY in -dropovercmd command)
+ - new command: reorder
+ - new command: visible
+ - less full-redraw
+
+* NoteBook:
+ - relief reworked
+ - added option -leavecmd on pages
+ - option -image implemented
+ - new command: move
+ - delete command now accept an optionnal argument specifying
+ whether the frame of the page should be destroyed or not.
+ If not, this frame is reused by insert command for the same page.
+
+* Entry and LabelEntry:
+ - direct access to entry command
+ - bind command added on the entry subwidget
+
+* ComboBox:
+ - option -postcommand added
+ - bind command added on the entry subwidget
+
+* SpinBox:
+ - bind command added on the entry subwidget
+ - floating point fixed - work needed
+
+* ProgressBar:
+ - now can be incremental or not limited ('unknow-time' processing)
+
+* Bitmap:
+ - xpm image type added with use of xpm-to-image by Roger E. Critchlow Jr.
+
+* Lots of focus problem solved
+
+* ...and bugs corrected.
+
+
+INCOMPATIBILITIES
+
+ Incompatibilities are very localized, so we hope that it will
+ not be painfull to upgrade to 1.2.
+
+* MainFrame related imcompatibilities
+ - Upgrade MainFrame -menu option and change -variable option
+ by -progressvar.
+
+* Drag and drop related imcompatibilities
+ - Upgrade -dragevent option, and command associated to -draginitcmd
+ and -dropovercmd.
+ - Upgrade -dragendcmd/-dragovercmd command of Tree and ListBox widget
+
+* Edition in Tree and ListBox
+ - Verify arguments passed in call to edit command of
+ Tree and ListBox
+
+
+____________________________________________________________
+BWidget 1.1 (03/12/1999)
+
+CHANGES FROM 1.0 TO 1.1
+
+WHAT'S NEW
+
+The most important change in BWidget 1.1 is the support
+of tk path command, but the old syntax is always available.
+configure command now returns a valid configuration information list.
+
+(I hope that) All submitted bugs have been corrected.
+
+Following widget have been reworked:
+
+* ListBox:
+ - ListBox items have now a -indent option.
+ - insert command modified to look more as a tk
+ listbox insert command (see INCOMPATIBILITIES)
+ - item command added to retreive one or more items
+
+* Tree:
+ - insert command modified to look more as a
+ listbox insert command (see INCOMPATIBILITIES)
+
+* LabelEntry:
+ - -value and -variable options renamed to -text and -textvariable
+ (see INCOMPATIBILITIES)
+
+* SpinBox and ComboBox:
+ - -value and -variable options renamed to -text and -textvariable
+ (see INCOMPATIBILITIES)
+ - New command getvalue and setvalue added to manipulate
+ current value by index.
+
+* NoteBook:
+ - Pages have now an identifier.
+ - insert command modififed (see INCOMPATIBILITIES)
+ - page command added to retreive one or more pages
+ - getframe command added
+
+
+INCOMPATIBILITIES (sorry for this)
+
+* LabelEntry, SpinBox and ComboBox:
+ - -value and -variable options renamed to -text and -textvariable
+
+* Entry and LabelEntry:
+ - setfocus doesn't exist anymore. Directly use tk command focus.
+
+* NoteBook:
+ - Pages have now an identifier, which modifies insert command:
+ NoteBook::insert $nb index ?option value ...?
+ is now
+ $nb insert index page ?option value ...?
+
+* Tree:
+ - insert command modified:
+ Tree::insert $nb $parent $node $index ?option value ...?
+ becomes
+ $tree insert $index $parent $node ?option value ...?
+
+* ListBox:
+ - insert command modified:
+ ListBox::insert $list $item $index ?option value ...?
+ becomes
+ $list insert $index $item ?option value ...?
+
+
+____________________________________________________________
+BWidget 1.0 (02/19/1999)
+
+ First release.
+
ADDED LGPL.txt
Index: LGPL.txt
==================================================================
--- /dev/null
+++ LGPL.txt
@@ -0,0 +1,481 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
ADDED LICENSE.txt
Index: LICENSE.txt
==================================================================
--- /dev/null
+++ LICENSE.txt
@@ -0,0 +1,17 @@
+BWidget ToolKit
+Copyright (c) 1998-1999 UNIFIX.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
ADDED README.txt
Index: README.txt
==================================================================
--- /dev/null
+++ README.txt
@@ -0,0 +1,148 @@
+07/09/1999
+BWidget ToolKit 1.2.1
+Copyright (c) 1998-1999 UNIFIX.
+
+--------------------------------------------------------------------------
+WHAT IS BWIDGET ?
+
+The BWidget Toolkit is a high-level Widgets Set for Tcl/Tk built using
+native Tcl/Tk 8.x namespaces.
+
+The BWidgets have a professional look&feel as in other well known Toolkits
+(Tix or Incr Widget) but the concept is radically different because everything is
+native so no platform compilation, no compiled extension library are needed.
+The code is 100% Pure Tcl/Tk.
+
+
+--------------------------------------------------------------------------
+WIDGET LIST (1.2.1)
+
+Simple Widgets
+ Label Extended Label widget
+ Entry Extended Entry widget
+ Button Extended Button widget
+ ArrowButton Button widget with an arrow shape.
+ ProgressBar Progress indicator widget
+ ScrollView Display the visible area of a scrolled window
+ Separator 3D separator widget
+
+Manager Widgets
+ MainFrame Manage toplevel with menu, toolbar and statusbar
+ LabelFrame Frame with a Label
+ TitleFrame Frame with a title
+ ScrolledWindow Generic scrolled widget
+ ScrollableFrame Scrollable frame containing widget
+ PanedWindow Tiled layout manager widget
+ ButtonBox Set of buttons with horizontal or vertical layout
+ PagesManager Pages manager widget
+ NoteBook Notebook manager widget
+ Dialog Dialog abstraction with custom buttons
+
+Composite Widgets
+ LabelEntry LabelFrame containing an Entry widget.
+ ComboBox ComboBox widget
+ SpinBox SpinBox widget
+ Tree Tree widget
+ ListBox ListBox widget
+ MessageDlg Message dialog box
+ ProgressDlg Progress indicator dialog box
+ PasswdDlg Login/Password dialog box (contributed by Stephane Lavirotte)
+ SelectFont Font selection widget
+ SelectColor Color selection widget
+
+Commands Classes
+ Widget The Widget base class
+ DynamicHelp Provide help to Tk widget or BWidget
+ DragSite Commands set for Drag facilities
+ DropSite Commands set for Drop facilities
+ BWidget Utilities
+
+--------------------------------------------------------------------------
+INSTALLATION AND USE
+
+- On Unix Platform:
+ Uncompress the file BWidget-1.2.1.tar.Z or BWidget-1.2.1.tar.gz
+
+ To use the BWidget:
+ - If you have uncompressed the archive file under the Tcl Library Path
+ directory, you only need to do:
+ % package require BWidget
+ - If not, you have to specify the BWidget installation path in auto_path
+ global variable:
+ % lappend auto_path
+ % package require BWidget
+
+ To launch the demo, you need to cd into the demo subdirectory:
+ $ cd /demo
+ $ wish demo.tcl
+
+- On Windows and others Platforms:
+ Uncompress the file BWidget-1.2.1.zip
+
+ To use the BWidget:
+ - If you uncompressed the archive file under the Tcl Library Path
+ directory, you only need to do:
+ % package require BWidget
+ - If not, you have to specify the BWidget installation path in auto_path
+ global variable:
+ % lappend auto_path your_path
+ % package require BWidget
+
+ To launch the demo :
+ Double click on demo.tcl in the demo subdirectory
+
+
+Distribution contains these directories:
+
+BWidget-1.2 Root directory and BWidget Tcl sources
+ BWman HTML manual pages
+ images images used by BWidget
+ lang Resources for language customization
+ demo Demo sources
+
+
+--------------------------------------------------------------------------
+DOCUMENTATION
+
+HTML manual pages are available in the BWman subdirectory.
+Points to index.html for frame version with tree navigation,
+or to contents.html for no frame version.
+
+Look at http://www.unifix-online.com/BWidget for last revision
+of manual pages.
+
+
+--------------------------------------------------------------------------
+LICENSE
+
+BWidget ToolKit 1.2.1
+Copyright (c) 1998-1999 UNIFIX.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with this library; if not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.
+
+
+License is also in LICENSE.txt. You can find LGPL.txt too.
+
+--------------------------------------------------------------------------
+CONTACTS
+
+Mail mailto:bwidget@unifix-online.com
+Home page http://www.unifix-online.com/BWidget/
+
+Bug Report and FAQ : See Home Page
+
+
+
ADDED arrow.tcl
Index: arrow.tcl
==================================================================
--- /dev/null
+++ arrow.tcl
@@ -0,0 +1,548 @@
+# ------------------------------------------------------------------------------
+# arrow.tcl
+# This file is part of Unifix BWidget Toolkit
+# ------------------------------------------------------------------------------
+# Index of commands:
+# Public commands
+# - ArrowButton::create
+# - ArrowButton::configure
+# - ArrowButton::cget
+# - ArrowButton::invoke
+# Private commands (redraw commands)
+# - ArrowButton::_redraw
+# - ArrowButton::_redraw_state
+# - ArrowButton::_redraw_relief
+# - ArrowButton::_redraw_whole
+# Private commands (event bindings)
+# - ArrowButton::_destroy
+# - ArrowButton::_enter
+# - ArrowButton::_leave
+# - ArrowButton::_press
+# - ArrowButton::_release
+# - ArrowButton::_repeat
+# ------------------------------------------------------------------------------
+
+namespace eval ArrowButton {
+
+ Widget::tkinclude ArrowButton button :cmd \
+ include {
+ -borderwidth -bd -background -bg -relief
+ -highlightbackground -highlightcolor -highlightthickness -takefocus}
+
+ Widget::declare ArrowButton {
+ {-type Enum button 0 {arrow button}}
+ {-dir Enum top 0 {top bottom left right}}
+ {-width Int 15 0 {=0}}
+ {-height Int 15 0 {=0}}
+ {-ipadx Int 0 0 {=0}}
+ {-ipady Int 0 0 {=0}}
+ {-clean Int 2 0 {=0 =2}}
+ {-activeforeground TkResource "" 0 button}
+ {-activebackground TkResource "" 0 button}
+ {-disabledforeground TkResource "" 0 button}
+ {-foreground TkResource "" 0 button}
+ {-state TkResource "" 0 button}
+
+ {-troughcolor TkResource "" 0 scrollbar}
+ {-arrowbd Int 1 0 {=1 =2}}
+ {-arrowrelief Enum raised 0 {raised sunken}}
+
+ {-command String "" 0}
+ {-armcommand String "" 0}
+ {-disarmcommand String "" 0}
+ {-repeatdelay Int 0 0 {=0}}
+ {-repeatinterval Int 0 0 {=0}}
+
+ {-bd Synonym -borderwidth}
+ {-fg Synonym -foreground}
+ }
+ DynamicHelp::include ArrowButton balloon
+
+ proc ::ArrowButton { path args } { return [eval ArrowButton::create $path $args] }
+
+ proc use {} {}
+
+ bind BwArrowButton {ArrowButton::_enter %W}
+ bind BwArrowButton {ArrowButton::_leave %W}
+ bind BwArrowButton {ArrowButton::_press %W}
+ bind BwArrowButton {ArrowButton::_release %W}
+ bind BwArrowButton {ArrowButton::invoke %W; break}
+ bind BwArrowButton {ArrowButton::invoke %W; break}
+ bind BwArrowButton {ArrowButton::_redraw_whole %W %w %h}
+ bind BwArrowButton {ArrowButton::_destroy %W}
+
+ variable _grab
+ variable _moved
+
+ array set _grab {current "" pressed "" oldstate "" oldrelief ""}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::create
+# ------------------------------------------------------------------------------
+proc ArrowButton::create { path args } {
+ variable _moved
+
+ Widget::init ArrowButton $path $args
+
+ set w [Widget::getoption $path -width]
+ set h [Widget::getoption $path -height]
+ set bd [Widget::getoption $path -borderwidth]
+ set ht [Widget::getoption $path -highlightthickness]
+ set pad [expr {2*($bd+$ht)}]
+
+ eval canvas $path [Widget::subcget $path :cmd] \
+ -width [expr {$w-$pad}] -height [expr {$h-$pad}]
+ bindtags $path [list $path BwArrowButton [winfo toplevel $path] all]
+
+ DynamicHelp::sethelp $path $path 1
+
+ set _moved($path) 0
+
+ rename $path ::$path:cmd
+ proc ::$path { cmd args } "return \[eval ArrowButton::\$cmd $path \$args\]"
+
+ return $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::configure
+# ------------------------------------------------------------------------------
+proc ArrowButton::configure { path args } {
+ set res [Widget::configure $path $args]
+
+ set ch1 [expr {[Widget::hasChanged $path -width w] |
+ [Widget::hasChanged $path -height h] |
+ [Widget::hasChanged $path -borderwidth bd] |
+ [Widget::hasChanged $path -highlightthickness ht]}]
+ set ch2 [expr {[Widget::hasChanged $path -type val] |
+ [Widget::hasChanged $path -ipadx val] |
+ [Widget::hasChanged $path -ipady val] |
+ [Widget::hasChanged $path -arrowbd val] |
+ [Widget::hasChanged $path -clean val] |
+ [Widget::hasChanged $path -dir val]}]
+
+ if { $ch1 } {
+ set pad [expr {2*($bd+$ht)}]
+ $path:cmd configure \
+ -width [expr {$w-$pad}] -height [expr {$h-$pad}] \
+ -borderwidth $bd -highlightthickness $ht
+ } elseif { $ch2 } {
+ _redraw_whole $path [winfo width $path] [winfo height $path]
+ } else {
+ _redraw_relief $path
+ _redraw_state $path
+ }
+ DynamicHelp::sethelp $path $path
+
+ return $res
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::cget
+# ------------------------------------------------------------------------------
+proc ArrowButton::cget { path option } {
+ return [Widget::cget $path $option]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::invoke
+# ------------------------------------------------------------------------------
+proc ArrowButton::invoke { path } {
+ if { [string compare [Widget::getoption $path -state] "disabled"] } {
+ set oldstate [Widget::getoption $path -state]
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ set oldrelief [Widget::getoption $path -relief]
+ configure $path -state active -relief sunken
+ } else {
+ set oldrelief [Widget::getoption $path -arrowrelief]
+ configure $path -state active -arrowrelief sunken
+ }
+ update idletasks
+ if { [set cmd [Widget::getoption $path -armcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ after 10
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ configure $path -state $oldstate -relief $oldrelief
+ } else {
+ configure $path -state $oldstate -arrowrelief $oldrelief
+ }
+ if { [set cmd [Widget::getoption $path -disarmcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { [set cmd [Widget::getoption $path -command]] != "" } {
+ uplevel \#0 $cmd
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_redraw
+# ------------------------------------------------------------------------------
+proc ArrowButton::_redraw { path width height } {
+ variable _moved
+
+ set _moved($path) 0
+ set type [Widget::getoption $path -type]
+ set dir [Widget::getoption $path -dir]
+ set bd [expr {[$path:cmd cget -borderwidth] + [$path:cmd cget -highlightthickness] + 1}]
+ set clean [Widget::getoption $path -clean]
+ if { ![string compare $type "arrow"] } {
+ if { [set id [$path:cmd find withtag rect]] == "" } {
+ $path:cmd create rectangle $bd $bd [expr {$width-$bd-1}] [expr {$height-$bd-1}] -tags rect
+ } else {
+ $path:cmd coords $id $bd $bd [expr {$width-$bd-1}] [expr {$height-$bd-1}]
+ }
+ $path:cmd lower rect
+ set arrbd [Widget::getoption $path -arrowbd]
+ set bd [expr {$bd+$arrbd-1}]
+ } else {
+ $path:cmd delete rect
+ }
+ # w and h are max width and max height of arrow
+ set w [expr {$width - 2*([Widget::getoption $path -ipadx]+$bd)}]
+ set h [expr {$height - 2*([Widget::getoption $path -ipady]+$bd)}]
+
+ if { $w < 2 } {set w 2}
+ if { $h < 2 } {set h 2}
+
+ if { $clean > 0 } {
+ # arrange for base to be odd
+ if { ![string compare $dir "top"] ||
+ ![string compare $dir "bottom"] } {
+ if { !($w % 2) } {
+ incr w -1
+ }
+ if { $clean == 2 } {
+ # arrange for h = (w+1)/2
+ set h2 [expr {($w+1)/2}]
+ if { $h2 > $h } {
+ set w [expr {2*$h-1}]
+ } else {
+ set h $h2
+ }
+ }
+ } else {
+ if { !($h % 2) } {
+ incr h -1
+ }
+ if { $clean == 2 } {
+ # arrange for w = (h+1)/2
+ set w2 [expr {($h+1)/2}]
+ if { $w2 > $w } {
+ set h [expr {2*$w-1}]
+ } else {
+ set w $w2
+ }
+ }
+ }
+ }
+
+ set x0 [expr {($width-$w)/2}]
+ set y0 [expr {($height-$h)/2}]
+ set x1 [expr {$x0+$w-1}]
+ set y1 [expr {$y0+$h-1}]
+
+ switch $dir {
+ top {
+ set xd [expr {($x0+$x1)/2}]
+ if { [set id [$path:cmd find withtag poly]] == "" } {
+ $path:cmd create polygon $x0 $y1 $x1 $y1 $xd $y0 -tags poly
+ } else {
+ $path:cmd coords $id $x0 $y1 $x1 $y1 $xd $y0
+ }
+ if { ![string compare $type "arrow"] } {
+ if { [set id [$path:cmd find withtag bot]] == "" } {
+ $path:cmd create line $x0 $y1 $x1 $y1 $xd $y0 -tags bot
+ } else {
+ $path:cmd coords $id $x0 $y1 $x1 $y1 $xd $y0
+ }
+ if { [set id [$path:cmd find withtag top]] == "" } {
+ $path:cmd create line $x0 $y1 $xd $y0 -tags top
+ } else {
+ $path:cmd coords $id $x0 $y1 $xd $y0
+ }
+ $path:cmd itemconfigure top -width $arrbd
+ $path:cmd itemconfigure bot -width $arrbd
+ } else {
+ $path:cmd delete top
+ $path:cmd delete bot
+ }
+ }
+ bottom {
+ set xd [expr {($x0+$x1)/2}]
+ if { [set id [$path:cmd find withtag poly]] == "" } {
+ $path:cmd create polygon $x1 $y0 $x0 $y0 $xd $y1 -tags poly
+ } else {
+ $path:cmd coords $id $x1 $y0 $x0 $y0 $xd $y1
+ }
+ if { ![string compare $type "arrow"] } {
+ if { [set id [$path:cmd find withtag top]] == "" } {
+ $path:cmd create line $x1 $y0 $x0 $y0 $xd $y1 -tags top
+ } else {
+ $path:cmd coords $id $x1 $y0 $x0 $y0 $xd $y1
+ }
+ if { [set id [$path:cmd find withtag bot]] == "" } {
+ $path:cmd create line $x1 $y0 $xd $y1 -tags bot
+ } else {
+ $path:cmd coords $id $x1 $y0 $xd $y1
+ }
+ $path:cmd itemconfigure top -width $arrbd
+ $path:cmd itemconfigure bot -width $arrbd
+ } else {
+ $path:cmd delete top
+ $path:cmd delete bot
+ }
+ }
+ left {
+ set yd [expr {($y0+$y1)/2}]
+ if { [set id [$path:cmd find withtag poly]] == "" } {
+ $path:cmd create polygon $x1 $y0 $x1 $y1 $x0 $yd -tags poly
+ } else {
+ $path:cmd coords $id $x1 $y0 $x1 $y1 $x0 $yd
+ }
+ if { ![string compare $type "arrow"] } {
+ if { [set id [$path:cmd find withtag bot]] == "" } {
+ $path:cmd create line $x1 $y0 $x1 $y1 $x0 $yd -tags bot
+ } else {
+ $path:cmd coords $id $x1 $y0 $x1 $y1 $x0 $yd
+ }
+ if { [set id [$path:cmd find withtag top]] == "" } {
+ $path:cmd create line $x1 $y0 $x0 $yd -tags top
+ } else {
+ $path:cmd coords $id $x1 $y0 $x0 $yd
+ }
+ $path:cmd itemconfigure top -width $arrbd
+ $path:cmd itemconfigure bot -width $arrbd
+ } else {
+ $path:cmd delete top
+ $path:cmd delete bot
+ }
+ }
+ right {
+ set yd [expr {($y0+$y1)/2}]
+ if { [set id [$path:cmd find withtag poly]] == "" } {
+ $path:cmd create polygon $x0 $y1 $x0 $y0 $x1 $yd -tags poly
+ } else {
+ $path:cmd coords $id $x0 $y1 $x0 $y0 $x1 $yd
+ }
+ if { ![string compare $type "arrow"] } {
+ if { [set id [$path:cmd find withtag top]] == "" } {
+ $path:cmd create line $x0 $y1 $x0 $y0 $x1 $yd -tags top
+ } else {
+ $path:cmd coords $id $x0 $y1 $x0 $y0 $x1 $yd
+ }
+ if { [set id [$path:cmd find withtag bot]] == "" } {
+ $path:cmd create line $x0 $y1 $x1 $yd -tags bot
+ } else {
+ $path:cmd coords $id $x0 $y1 $x1 $yd
+ }
+ $path:cmd itemconfigure top -width $arrbd
+ $path:cmd itemconfigure bot -width $arrbd
+ } else {
+ $path:cmd delete top
+ $path:cmd delete bot
+ }
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_redraw_state
+# ------------------------------------------------------------------------------
+proc ArrowButton::_redraw_state { path } {
+ set state [Widget::getoption $path -state]
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ switch $state {
+ normal {set bg -background; set fg -foreground}
+ active {set bg -activebackground; set fg -activeforeground}
+ disabled {set bg -background; set fg -disabledforeground}
+ }
+ set fg [Widget::getoption $path $fg]
+ $path:cmd configure -background [Widget::getoption $path $bg]
+ $path:cmd itemconfigure poly -fill $fg -outline $fg
+ } else {
+ switch $state {
+ normal {set stipple ""; set bg [Widget::getoption $path -background] }
+ active {set stipple ""; set bg [Widget::getoption $path -activebackground] }
+ disabled {set stipple gray50; set bg black }
+ }
+ set thrc [Widget::getoption $path -troughcolor]
+ $path:cmd configure -background [Widget::getoption $path -background]
+ $path:cmd itemconfigure rect -fill $thrc -outline $thrc
+ $path:cmd itemconfigure poly -fill $bg -outline $bg -stipple $stipple
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_redraw_relief
+# ------------------------------------------------------------------------------
+proc ArrowButton::_redraw_relief { path } {
+ variable _moved
+
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ if { ![string compare [Widget::getoption $path -relief] "sunken"] } {
+ if { !$_moved($path) } {
+ $path:cmd move poly 1 1
+ set _moved($path) 1
+ }
+ } else {
+ if { $_moved($path) } {
+ $path:cmd move poly -1 -1
+ set _moved($path) 0
+ }
+ }
+ } else {
+ set col3d [BWidget::get3dcolor $path [Widget::getoption $path -background]]
+ switch [Widget::getoption $path -arrowrelief] {
+ raised {set top [lindex $col3d 1]; set bot [lindex $col3d 0]}
+ sunken {set top [lindex $col3d 0]; set bot [lindex $col3d 1]}
+ }
+ $path:cmd itemconfigure top -fill $top
+ $path:cmd itemconfigure bot -fill $bot
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_redraw_whole
+# ------------------------------------------------------------------------------
+proc ArrowButton::_redraw_whole { path width height } {
+ _redraw $path $width $height
+ _redraw_relief $path
+ _redraw_state $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_destroy
+# ------------------------------------------------------------------------------
+proc ArrowButton::_destroy { path } {
+ variable _moved
+
+ Widget::destroy $path
+ unset _moved($path)
+ rename $path {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_enter
+# ------------------------------------------------------------------------------
+proc ArrowButton::_enter { path } {
+ variable _grab
+
+ set _grab(current) $path
+ if { [string compare [Widget::getoption $path -state] "disabled"] } {
+ set _grab(oldstate) [Widget::getoption $path -state]
+ configure $path -state active
+ if { $_grab(pressed) == $path } {
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ set _grab(oldrelief) [Widget::getoption $path -relief]
+ configure $path -relief sunken
+ } else {
+ set _grab(oldrelief) [Widget::getoption $path -arrowrelief]
+ configure $path -arrowrelief sunken
+ }
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_leave
+# ------------------------------------------------------------------------------
+proc ArrowButton::_leave { path } {
+ variable _grab
+
+ set _grab(current) ""
+ if { [string compare [Widget::getoption $path -state] "disabled"] } {
+ configure $path -state $_grab(oldstate)
+ if { $_grab(pressed) == $path } {
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ configure $path -relief $_grab(oldrelief)
+ } else {
+ configure $path -arrowrelief $_grab(oldrelief)
+ }
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_press
+# ------------------------------------------------------------------------------
+proc ArrowButton::_press { path } {
+ variable _grab
+
+ if { [string compare [Widget::getoption $path -state] "disabled"] } {
+ set _grab(pressed) $path
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ set _grab(oldrelief) [Widget::getoption $path -relief]
+ configure $path -relief sunken
+ } else {
+ set _grab(oldrelief) [Widget::getoption $path -arrowrelief]
+ configure $path -arrowrelief sunken
+ }
+ if { [set cmd [Widget::getoption $path -armcommand]] != "" } {
+ uplevel \#0 $cmd
+ if { [set delay [Widget::getoption $path -repeatdelay]] > 0 ||
+ [set delay [Widget::getoption $path -repeatinterval]] > 0 } {
+ after $delay "ArrowButton::_repeat $path"
+ }
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_release
+# ------------------------------------------------------------------------------
+proc ArrowButton::_release { path } {
+ variable _grab
+
+ if { $_grab(pressed) == $path } {
+ set _grab(pressed) ""
+ if { ![string compare [Widget::getoption $path -type] "button"] } {
+ configure $path -relief $_grab(oldrelief)
+ } else {
+ configure $path -arrowrelief $_grab(oldrelief)
+ }
+ if { [set cmd [Widget::getoption $path -disarmcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { $_grab(current) == $path &&
+ [string compare [Widget::getoption $path -state] "disabled"] &&
+ [set cmd [Widget::getoption $path -command]] != "" } {
+ uplevel \#0 $cmd
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ArrowButton::_repeat
+# ------------------------------------------------------------------------------
+proc ArrowButton::_repeat { path } {
+ variable _grab
+
+ if { $_grab(current) == $path && $_grab(pressed) == $path &&
+ [string compare [Widget::getoption $path -state] "disabled"] &&
+ [set cmd [Widget::getoption $path -armcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { $_grab(pressed) == $path &&
+ ([set delay [Widget::getoption $path -repeatinterval]] > 0 ||
+ [set delay [Widget::getoption $path -repeatdelay]] > 0) } {
+ after $delay "ArrowButton::_repeat $path"
+ }
+}
+
ADDED bitmap.tcl
Index: bitmap.tcl
==================================================================
--- /dev/null
+++ bitmap.tcl
@@ -0,0 +1,92 @@
+# ------------------------------------------------------------------------------
+# bitmap.tcl
+# This file is part of Unifix BWidget Toolkit
+# $Id: bitmap.tcl,v 1.1.1.1 1999/08/03 20:20:23 ericm Exp $
+# ------------------------------------------------------------------------------
+# Index of commands:
+# - Bitmap::get
+# - Bitmap::_init
+# ------------------------------------------------------------------------------
+namespace eval Bitmap {
+ variable path
+ variable _bmp
+ variable _types {
+ photo .gif
+ photo .ppm
+ bitmap .xbm
+ photo .xpm
+ }
+
+ proc use {} {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Bitmap::get
+# ------------------------------------------------------------------------------
+proc Bitmap::get { name } {
+ variable path
+ variable _bmp
+ variable _types
+
+ if {[info exists _bmp($name)]} {
+ return $_bmp($name)
+ }
+
+ # --- Nom de fichier avec extension ------------------------------------------------------
+ set ext [file extension $name]
+ if { $ext != "" } {
+ if { ![info exists _bmp($ext)] } {
+ error "$ext not supported"
+ }
+
+ if { [file exists $name] } {
+ if {![string compare $ext ".xpm"]} {
+ set _bmp($name) [xpm-to-image $name]
+ return $_bmp($name)
+ }
+ if {![catch {set _bmp($name) [image create $_bmp($ext) -file $name]}]} {
+ return $_bmp($name)
+ }
+ }
+ }
+
+ foreach dir $path {
+ foreach {type ext} $_types {
+ if { [file exists [file join $dir $name$ext]] } {
+ if {![string compare $ext ".xpm"]} {
+ set _bmp($name) [xpm-to-image [file join $dir $name$ext]]
+ return $_bmp($name)
+ } else {
+ if {![catch {set _bmp($name) [image create $type -file [file join $dir $name$ext]]}]} {
+ return $_bmp($name)
+ }
+ }
+ }
+ }
+ }
+
+ return -code error "$name not found"
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Bitmap::_init
+# ------------------------------------------------------------------------------
+proc Bitmap::_init { } {
+ global env
+ variable path
+ variable _bmp
+ variable _types
+
+ set path [list "." [file join $env(BWIDGET_LIBRARY) images]]
+ set supp [image types]
+ foreach {type ext} $_types {
+ if { [lsearch $supp $type] != -1} {
+ set _bmp($ext) $type
+ }
+ }
+}
+
+
+Bitmap::_init
ADDED button.tcl
Index: button.tcl
==================================================================
--- /dev/null
+++ button.tcl
@@ -0,0 +1,302 @@
+# ------------------------------------------------------------------------------
+# button.tcl
+# This file is part of Unifix BWidget Toolkit
+# ------------------------------------------------------------------------------
+# Index of commands:
+# Public commands
+# - Button::create
+# - Button::configure
+# - Button::cget
+# - Button::invoke
+# Private commands (event bindings)
+# - Button::_destroy
+# - Button::_enter
+# - Button::_leave
+# - Button::_press
+# - Button::_release
+# - Button::_repeat
+# ------------------------------------------------------------------------------
+
+namespace eval Button {
+ Widget::tkinclude Button button :cmd \
+ remove {-command -relief -text -textvariable -underline}
+
+ Widget::declare Button {
+ {-name String "" 0}
+ {-text String "" 0}
+ {-textvariable String "" 0}
+ {-underline Int -1 0 {=-1}}
+ {-armcommand String "" 0}
+ {-disarmcommand String "" 0}
+ {-command String "" 0}
+ {-repeatdelay Int 0 0 {=0 ""}}
+ {-repeatinterval Int 0 0 {=0 ""}}
+ {-relief Enum raised 0 {raised sunken flat ridge solid groove link}}
+ }
+
+ DynamicHelp::include Button balloon
+
+ Widget::syncoptions Button "" :cmd {-text {} -underline {}}
+
+ variable _current ""
+ variable _pressed ""
+
+ bind BwButton {Button::_enter %W}
+ bind BwButton {Button::_leave %W}
+ bind BwButton {Button::_press %W}
+ bind BwButton {Button::_release %W}
+ bind BwButton {Button::invoke %W; break}
+ bind BwButton {Button::invoke %W; break}
+ bind BwButton {Widget::destroy %W; rename %W {}}
+
+ proc ::Button { path args } { return [eval Button::create $path $args] }
+ proc use {} {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::create
+# ------------------------------------------------------------------------------
+proc Button::create { path args } {
+ Widget::init Button $path $args
+
+ set relief [Widget::getoption $path -relief]
+ if { ![string compare $relief "link"] } {
+ set relief "flat"
+ }
+
+ set var [Widget::getoption $path -textvariable]
+ if { ![string length $var] } {
+ set desc [BWidget::getname [Widget::getoption $path -name]]
+ if { [llength $desc] } {
+ set text [lindex $desc 0]
+ set under [lindex $desc 1]
+ Widget::setoption $path -text $text
+ Widget::setoption $path -underline $under
+ } else {
+ set text [Widget::getoption $path -text]
+ set under [Widget::getoption $path -underline]
+ }
+ } else {
+ set under -1
+ set text ""
+ Widget::setoption $path -underline $under
+ }
+
+ eval button $path [Widget::subcget $path :cmd] \
+ [list -relief $relief -text $text -underline $under -textvariable $var]
+ bindtags $path [list $path BwButton [winfo toplevel $path] all]
+
+ set accel [string tolower [string index $text $under]]
+ if { $accel != "" } {
+ bind [winfo toplevel $path] "Button::invoke $path"
+ }
+
+ DynamicHelp::sethelp $path $path 1
+
+ rename $path ::$path:cmd
+ proc ::$path { cmd args } "return \[eval Button::\$cmd $path \$args\]"
+
+ return $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::configure
+# ------------------------------------------------------------------------------
+proc Button::configure { path args } {
+ set oldunder [$path:cmd cget -underline]
+ if { $oldunder != -1 } {
+ set oldaccel [string tolower [string index [$path:cmd cget -text] $oldunder]]
+ } else {
+ set oldaccel ""
+ }
+ set res [Widget::configure $path $args]
+
+ set rc [Widget::hasChanged $path -relief relief]
+ set sc [Widget::hasChanged $path -state state]
+
+ if { $rc || $sc } {
+ if { ![string compare $relief "link"] } {
+ if { ![string compare $state "active"] } {
+ set relief "raised"
+ } else {
+ set relief "flat"
+ }
+ }
+ $path:cmd configure -relief $relief -state $state
+ }
+
+ set cv [Widget::hasChanged $path -textvariable var]
+ set cn [Widget::hasChanged $path -name name]
+ set ct [Widget::hasChanged $path -text text]
+ set cu [Widget::hasChanged $path -underline under]
+
+ if { $cv || $cn || $ct || $cu } {
+ if { ![string length $var] } {
+ set desc [BWidget::getname $name]
+ if { [llength $desc] } {
+ set text [lindex $desc 0]
+ set under [lindex $desc 1]
+ }
+ } else {
+ set under -1
+ set text ""
+ }
+ set top [winfo toplevel $path]
+ bind $top {}
+ set accel [string tolower [string index $text $under]]
+ if { $accel != "" } {
+ bind $top "Button::invoke $path"
+ }
+ $path:cmd configure -text $text -underline $under -textvariable $var
+ }
+ DynamicHelp::sethelp $path $path
+
+ return $res
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::cget
+# ------------------------------------------------------------------------------
+proc Button::cget { path option } {
+ return [Widget::cget $path $option]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::invoke
+# ------------------------------------------------------------------------------
+proc Button::invoke { path } {
+ if { [string compare [$path:cmd cget -state] "disabled"] } {
+ $path:cmd configure -state active -relief sunken
+ update idletasks
+ if { [set cmd [Widget::getoption $path -armcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ after 100
+ set relief [Widget::getoption $path -relief]
+ if { ![string compare $relief "link"] } {
+ set relief flat
+ }
+ $path:cmd configure \
+ -state [Widget::getoption $path -state] \
+ -relief $relief
+ if { [set cmd [Widget::getoption $path -disarmcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { [set cmd [Widget::getoption $path -command]] != "" } {
+ uplevel \#0 $cmd
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::_enter
+# ------------------------------------------------------------------------------
+proc Button::_enter { path } {
+ variable _current
+ variable _pressed
+
+ set _current $path
+ if { [string compare [$path:cmd cget -state] "disabled"] } {
+ $path:cmd configure -state active
+ if { $_pressed == $path } {
+ $path:cmd configure -relief sunken
+ } elseif { ![string compare [Widget::getoption $path -relief] "link"] } {
+ $path:cmd configure -relief raised
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::_leave
+# ------------------------------------------------------------------------------
+proc Button::_leave { path } {
+ variable _current
+ variable _pressed
+
+ set _current ""
+ if { [string compare [$path:cmd cget -state] "disabled"] } {
+ $path:cmd configure -state [Widget::getoption $path -state]
+ set relief [Widget::getoption $path -relief]
+ if { $_pressed == $path } {
+ if { ![string compare $relief "link"] } {
+ set relief raised
+ }
+ $path:cmd configure -relief $relief
+ } elseif { ![string compare $relief "link"] } {
+ $path:cmd configure -relief flat
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::_press
+# ------------------------------------------------------------------------------
+proc Button::_press { path } {
+ variable _pressed
+
+ if { [string compare [$path:cmd cget -state] "disabled"] } {
+ set _pressed $path
+ $path:cmd configure -relief sunken
+ if { [set cmd [Widget::getoption $path -armcommand]] != "" } {
+ uplevel \#0 $cmd
+ if { [set delay [Widget::getoption $path -repeatdelay]] > 0 ||
+ [set delay [Widget::getoption $path -repeatinterval]] > 0 } {
+ after $delay "Button::_repeat $path"
+ }
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::_release
+# ------------------------------------------------------------------------------
+proc Button::_release { path } {
+ variable _current
+ variable _pressed
+
+ if { $_pressed == $path } {
+ set _pressed ""
+ set relief [Widget::getoption $path -relief]
+ if { ![string compare $relief "link"] } {
+ set relief raised
+ }
+ $path:cmd configure -relief $relief
+ if { [set cmd [Widget::getoption $path -disarmcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { $_current == $path &&
+ [string compare [$path:cmd cget -state] "disabled"] &&
+ [set cmd [Widget::getoption $path -command]] != "" } {
+ uplevel \#0 $cmd
+ }
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command Button::_repeat
+# ------------------------------------------------------------------------------
+proc Button::_repeat { path } {
+ variable _current
+ variable _pressed
+
+ if { $_current == $path && $_pressed == $path &&
+ [string compare [$path:cmd cget -state] "disabled"] &&
+ [set cmd [Widget::getoption $path -armcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { $_pressed == $path &&
+ ([set delay [Widget::getoption $path -repeatinterval]] > 0 ||
+ [set delay [Widget::getoption $path -repeatdelay]] > 0) } {
+ after $delay "Button::_repeat $path"
+ }
+}
+
ADDED buttonbox.tcl
Index: buttonbox.tcl
==================================================================
--- /dev/null
+++ buttonbox.tcl
@@ -0,0 +1,226 @@
+# ------------------------------------------------------------------------------
+# buttonbox.tcl
+# This file is part of Unifix BWidget Toolkit
+# ------------------------------------------------------------------------------
+# Index of commands:
+# - ButtonBox::create
+# - ButtonBox::configure
+# - ButtonBox::cget
+# - ButtonBox::add
+# - ButtonBox::itemconfigure
+# - ButtonBox::itemcget
+# - ButtonBox::setfocus
+# - ButtonBox::invoke
+# - ButtonBox::index
+# - ButtonBox::_destroy
+# ------------------------------------------------------------------------------
+
+namespace eval ButtonBox {
+ Button::use
+
+ Widget::declare ButtonBox {
+ {-background TkResource "" 0 frame}
+ {-orient Enum horizontal 1 {horizontal vertical}}
+ {-homogeneous Boolean 1 1}
+ {-spacing Int 10 0 {=0}}
+ {-padx TkResource "" 0 button}
+ {-pady TkResource "" 0 button}
+ {-default Int -1 0 {=-1}}
+ {-bg Synonym -background}
+ }
+
+ Widget::addmap ButtonBox "" :cmd {-background {}}
+
+ proc ::ButtonBox { path args } { return [eval ButtonBox::create $path $args] }
+ proc use {} {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::create
+# ------------------------------------------------------------------------------
+proc ButtonBox::create { path args } {
+ Widget::init ButtonBox $path $args
+
+ variable $path
+ upvar 0 $path data
+
+ eval frame $path [Widget::subcget $path :cmd] -takefocus 0 -highlightthickness 0
+
+ set data(default) [Widget::getoption $path -default]
+ set data(nbuttons) 0
+ set data(max) 0
+
+ bind $path "ButtonBox::_destroy $path"
+
+ rename $path ::$path:cmd
+ proc ::$path { cmd args } "return \[eval ButtonBox::\$cmd $path \$args\]"
+
+ return $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::configure
+# ------------------------------------------------------------------------------
+proc ButtonBox::configure { path args } {
+ variable $path
+ upvar 0 $path data
+
+ set res [Widget::configure $path $args]
+
+ if { [Widget::hasChanged $path -default val] } {
+ if { $data(default) != -1 && $val != -1 } {
+ set but $path.b$data(default)
+ if { [winfo exists $but] } {
+ $but configure -default normal
+ }
+ set but $path.b$val
+ if { [winfo exists $but] } {
+ $but configure -default active
+ }
+ set data(default) $val
+ } else {
+ Widget::setoption $path -default $data(default)
+ }
+ }
+
+ return $res
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::cget
+# ------------------------------------------------------------------------------
+proc ButtonBox::cget { path option } {
+ return [Widget::cget $path $option]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::add
+# ------------------------------------------------------------------------------
+proc ButtonBox::add { path args } {
+ variable $path
+ upvar 0 $path data
+
+ set but $path.b$data(nbuttons)
+ set spacing [Widget::getoption $path -spacing]
+
+ if { $data(nbuttons) == $data(default) } {
+ set style active
+ } elseif { $data(default) == -1 } {
+ set style disabled
+ } else {
+ set style normal
+ }
+
+ eval Button::create $but \
+ -background [Widget::getoption $path -background]\
+ -padx [Widget::getoption $path -padx] \
+ -pady [Widget::getoption $path -pady] \
+ $args \
+ -default $style
+
+ set idx [expr {2*$data(nbuttons)}]
+ if { ![string compare [Widget::getoption $path -orient] "horizontal"] } {
+ grid $but -column $idx -row 0 -sticky nsew
+ if { [Widget::getoption $path -homogeneous] } {
+ set req [winfo reqwidth $but]
+ if { $req > $data(max) } {
+ for {set i 0} {$i < $data(nbuttons)} {incr i} {
+ grid columnconfigure $path [expr {2*$i}] -minsize $req
+ }
+ set data(max) $req
+ }
+ grid columnconfigure $path $idx -minsize $data(max) -weight 1
+ } else {
+ grid columnconfigure $path $idx -weight 0
+ }
+ if { $data(nbuttons) > 0 } {
+ grid columnconfigure $path [expr {$idx-1}] -minsize $spacing
+ }
+ } else {
+ grid $but -column 0 -row $idx -sticky nsew
+ grid rowconfigure $path $idx -weight 0
+ if { $data(nbuttons) > 0 } {
+ grid rowconfigure $path [expr {$idx-1}] -minsize $spacing
+ }
+ }
+
+ incr data(nbuttons)
+
+ return $but
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::itemconfigure
+# ------------------------------------------------------------------------------
+proc ButtonBox::itemconfigure { path index args } {
+ if { [set idx [lsearch $args -default]] != -1 } {
+ set args [lreplace $args $idx [expr {$idx+1}]]
+ }
+ return [eval Button::configure $path.b[index $path $index] $args]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::itemcget
+# ------------------------------------------------------------------------------
+proc ButtonBox::itemcget { path index option } {
+ return [Button::cget $path.b[index $path $index] $option]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::setfocus
+# ------------------------------------------------------------------------------
+proc ButtonBox::setfocus { path index } {
+ set but $path.b[index $path $index]
+ if { [winfo exists $but] } {
+ focus $but
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::invoke
+# ------------------------------------------------------------------------------
+proc ButtonBox::invoke { path index } {
+ set but $path.b[index $path $index]
+ if { [winfo exists $but] } {
+ Button::invoke $but
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::index
+# ------------------------------------------------------------------------------
+proc ButtonBox::index { path index } {
+ if { ![string compare $index "default"] } {
+ set res [Widget::getoption $path -default]
+ } elseif { ![string compare $index "end"] || ![string compare $index "last"] } {
+ variable $path
+ upvar 0 $path data
+
+ set res [expr {$data(nbuttons)-1}]
+ } else {
+ set res $index
+ }
+ return $res
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ButtonBox::_destroy
+# ------------------------------------------------------------------------------
+proc ButtonBox::_destroy { path } {
+ variable $path
+ upvar 0 $path data
+
+ Widget::destroy $path
+ unset data
+ rename $path {}
+}
ADDED color.tcl
Index: color.tcl
==================================================================
--- /dev/null
+++ color.tcl
@@ -0,0 +1,314 @@
+# ------------------------------------------------------------------------------
+# color.tcl
+# This file is part of Unifix BWidget Toolkit
+# ------------------------------------------------------------------------------
+# Index of commands:
+# - SelectColor::create
+# - SelectColor::setcolor
+# - SelectColor::_destroy
+# - SelectColor::_update_var
+# - SelectColor::_post_menu
+# - SelectColor::_tk_choose_color
+# - SelectColor::_activate
+# ------------------------------------------------------------------------------
+
+namespace eval SelectColor {
+ Widget::declare SelectColor {
+ {-title String "" 0}
+ {-parent String "" 0}
+ {-type Enum dialog 1 {dialog menubutton}}
+ {-command String "" 0}
+ {-color TkResource "" 0 {label -background}}
+ {-variable String "" 0}
+ {-width TkResource 15 0 frame}
+ {-height TkResource 15 0 frame}
+ }
+
+ Widget::addmap SelectColor "" :cmd {-width {} -height {}}
+ Widget::syncoptions SelectColor "" :cmd {-color -background}
+
+ variable _tabcolors {
+ \#0000ff \#000099 \#000000 white
+ \#00ff00 \#009900 \#333333 white
+ \#00ffff \#009999 \#666666 white
+ \#ff0000 \#990000 \#999999 white
+ \#ff00ff \#990099 \#cccccc white
+ \#ffff00 \#999900 \#ffffff
+ }
+
+ # bindings
+ bind SelectColor {SelectColor::_post_menu %W %X %Y}
+ bind SelectColor {SelectColor::_destroy %W}
+
+ variable _widget
+
+ proc ::SelectColor { path args } { return [eval SelectColor::create $path $args] }
+ proc use {} {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::create
+# ------------------------------------------------------------------------------
+proc SelectColor::create { path args } {
+ variable _tabcolors
+ variable _widget
+
+ Widget::init SelectColor $path $args
+
+ if { ![string compare [Widget::getoption $path -type] "menubutton"] } {
+ if { [set var [Widget::getoption $path -variable]] != "" } {
+ set _widget($path,var) $var
+ if { [GlobalVar::exists $var] } {
+ Widget::setoption $path -color [GlobalVar::getvar $var]
+ } else {
+ GlobalVar::setvar $var [Widget::getoption $path -color]
+ }
+ GlobalVar::tracevar variable $var w "SelectColor::_update_var $path"
+ } else {
+ set _widget($path,var) ""
+ }
+
+ eval frame $path [Widget::subcget $path :cmd] \
+ -background [Widget::getoption $path -color] \
+ -relief raised -borderwidth 2 -highlightthickness 0
+ bindtags $path [list $path SelectColor . all]
+ set _widget($path,idx) 0
+
+ rename $path ::$path:cmd
+ proc ::$path { cmd args } "return \[eval SelectColor::\$cmd $path \$args\]"
+ } else {
+ set parent [Widget::getoption $path -parent]
+ set title [Widget::getoption $path -title]
+ set lopt [list -initialcolor [Widget::getoption $path -color]]
+ if { [winfo exists $parent] } {
+ lappend lopt -parent $parent
+ }
+ if { $title != "" } {
+ lappend lopt -title $title
+ }
+ set col [eval tk_chooseColor $lopt]
+ Widget::destroy $path
+ return $col
+ }
+
+ return $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::configure
+# ------------------------------------------------------------------------------
+proc SelectColor::configure { path args } {
+ variable _widget
+
+ set res [Widget::configure $path $args]
+
+ if { [Widget::hasChanged $path -variable var] } {
+ if { [string length $_widget($path,var)] } {
+ GlobalVar::tracevar vdelete $_widget($path,var) w "SelectColor::_update_var $path"
+ }
+ set _widget($path,var) $var
+ if { [string length $_widget($path,var)] } {
+ Widget::hasChanged $path -color curval
+ if { [GlobalVar::exists $_widget($path,var)] } {
+ Widget::setoption $path -color [set curval [GlobalVar::getvar $_widget($path,var)]]
+ } else {
+ GlobalVar::setvar $_widget($path,var) $curval
+ }
+ GlobalVar::tracevar variable $_widget($path,var) w "SelectColor::_update_var $path"
+ $path:cmd configure -background $curval
+ }
+ }
+
+ if { [Widget::hasChanged $path -color curval] } {
+ if { [string length $_widget($path,var)] } {
+ Widget::setoption $path -color [GlobalVar::getvar $_widget($path,var)]
+ } else {
+ $path:cmd configure -background $curval
+ }
+ }
+ return $res
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::cget
+# ------------------------------------------------------------------------------
+proc SelectColor::cget { path option } {
+ return [Widget::cget $path $option]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::setcolor
+# ------------------------------------------------------------------------------
+proc SelectColor::setcolor { index color } {
+ variable _tabcolors
+ variable _widget
+
+ if { $index >= 1 && $index <= 5 } {
+ set idx [expr {int($idx) * 3}]
+ set _tabcolors [lreplace $_tabcolors $idx $idx $color]
+ return 1
+ }
+ return 0
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::_destroy
+# ------------------------------------------------------------------------------
+proc SelectColor::_destroy { path } {
+ variable _widget
+
+ if { [string length $_widget($path,var)] } {
+ GlobalVar::tracevar vdelete $_widget($path,var) w "SelectColor::_update_var $path"
+ }
+ unset _widget($path,var)
+ unset _widget($path,idx)
+ Widget::destroy $path
+ rename $path {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::_update_var
+# ------------------------------------------------------------------------------
+proc SelectColor::_update_var { path args } {
+ variable _tabcolors
+ variable _widget
+
+ set col [GlobalVar::getvar $_widget($path,var)]
+ $path:cmd configure -background $col
+ Widget::setoption $path -color $col
+ set _widget($path,idx) [lsearch $_tabcolors $col]
+ if { $_widget($path,idx) == -1 } {
+ set _widget($path,idx) 0
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::_post_menu
+# ------------------------------------------------------------------------------
+proc SelectColor::_post_menu { path X Y } {
+ global env
+ variable _tabcolors
+ variable _widget
+
+ if { [winfo exists $path.menu] } {
+ if { [string compare [winfo containing $X $Y] $path] } {
+ BWidget::grab release $path
+ destroy $path.menu
+ }
+ return
+ }
+
+ set top [menu $path.menu]
+ wm withdraw $top
+ wm transient $top [winfo toplevel $path]
+ set col 0
+ set row 0
+ set count 0
+ set frame [frame $top.frame -highlightthickness 0 -relief raised -borderwidth 2]
+ foreach color $_tabcolors {
+ set f [frame $frame.c$count \
+ -relief flat -bd 0 -highlightthickness 1 \
+ -width 16 -height 16 -background $color]
+ bind $f "SelectColor::_activate $path %W"
+ bind $f {focus %W}
+ grid $f -column $col -row $row -padx 1 -pady 1
+ bindtags $f $f
+ incr row
+ incr count
+ if { $row == 4 } {
+ set row 0
+ incr col
+ }
+ }
+ set f [label $frame.c$count \
+ -relief flat -bd 0 -highlightthickness 1 \
+ -width 16 -height 16 -image [Bitmap::get palette]]
+ grid $f -column $col -row $row -padx 1 -pady 1
+ bind $f "SelectColor::_tk_choose_color $path"
+ bind $f {focus %W}
+ pack $frame
+
+ BWidget::place $top 0 0 below $path
+
+ wm deiconify $top
+ raise $top
+ focus $frame
+ focus $top.frame.c$_widget($path,idx)
+ BWidget::grab set $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::_tk_choose_color
+# ------------------------------------------------------------------------------
+proc SelectColor::_tk_choose_color { path } {
+ variable _tabcolors
+ variable _widget
+
+ BWidget::grab release $path
+ destroy $path.menu
+ set parent [Widget::getoption $path -parent]
+ set title [Widget::getoption $path -title]
+ set lopt [list -initialcolor [$path:cmd cget -background]]
+ if { [winfo exists $parent] } {
+ lappend lopt -parent $parent
+ }
+ if { $title != "" } {
+ lappend lopt -title $title
+ }
+ set col [eval tk_chooseColor $lopt]
+ if { $col != "" } {
+ if { $_widget($path,idx) % 4 == 3 } {
+ set idx $_widget($path,idx)
+ } else {
+ set idx -1
+ for {set i 3} {$i < 15} {incr i 4} {
+ if { [lindex $_tabcolors $i] == "white" } {
+ set idx $i
+ break
+ }
+ }
+ }
+ if { $idx != -1 } {
+ set _tabcolors [lreplace $_tabcolors $idx $idx $col]
+ set _widget($path,idx) $idx
+ }
+ if { [info exists _widget($path,var)] } {
+ GlobalVar::setvar $_widget($path,var) $col
+ }
+ if { [set cmd [Widget::getoption $path -command]] != "" } {
+ uplevel \#0 $cmd
+ }
+ $path:cmd configure -background $col
+ }
+}
+
+
+# ------------------------------------------------------------------------------
+# Command SelectColor::_activate
+# ------------------------------------------------------------------------------
+proc SelectColor::_activate { path cell } {
+ variable _tabcolors
+ variable _widget
+
+ BWidget::grab release $path
+ set col [$cell cget -background]
+ destroy $path.menu
+ if { [string length $_widget($path,var)] } {
+ GlobalVar::setvar $_widget($path,var) $col
+ }
+ Widget::setoption $path -color $col
+ $path:cmd configure -background $col
+
+ if { [set cmd [Widget::getoption $path -command]] != "" } {
+ uplevel \#0 $cmd
+ }
+ set _widget($path,idx) [string range [lindex [split $cell "."] end] 1 end]
+}
ADDED combobox.tcl
Index: combobox.tcl
==================================================================
--- /dev/null
+++ combobox.tcl
@@ -0,0 +1,340 @@
+# ------------------------------------------------------------------------------
+# combobox.tcl
+# This file is part of Unifix BWidget Toolkit
+# $Id: combobox.tcl,v 1.1.1.1 1999/08/03 20:20:23 ericm Exp $
+# ------------------------------------------------------------------------------
+# Index of commands:
+# - ComboBox::create
+# - ComboBox::configure
+# - ComboBox::cget
+# - ComboBox::setvalue
+# - ComboBox::getvalue
+# - ComboBox::_create_popup
+# - ComboBox::_mapliste
+# - ComboBox::_unmapliste
+# - ComboBox::_select
+# - ComboBox::_modify_value
+# ------------------------------------------------------------------------------
+
+namespace eval ComboBox {
+ ArrowButton::use
+ Entry::use
+ LabelFrame::use
+
+ Widget::bwinclude ComboBox LabelFrame .labf \
+ rename {-text -label} \
+ remove {-focus} \
+ prefix {label -justify -width -anchor -height -font} \
+ initialize {-relief sunken -borderwidth 2}
+
+ Widget::bwinclude ComboBox Entry .e \
+ remove {-relief -bd -borderwidth -bg -fg} \
+ rename {-foreground -entryfg -background -entrybg}
+
+ Widget::declare ComboBox {
+ {-height TkResource 0 0 listbox}
+ {-values String "" 0}
+ {-modifycmd String "" 0}
+ {-postcommand String "" 0}
+ }
+
+ Widget::addmap ComboBox "" :cmd {-background {}}
+ Widget::addmap ComboBox ArrowButton .a \
+ {-foreground {} -background {} -disabledforeground {} -state {}}
+
+ Widget::syncoptions ComboBox Entry .e {-text {}}
+ Widget::syncoptions ComboBox LabelFrame .labf {-label -text -underline {}}
+
+ ::bind BwComboBox {focus %W.labf}
+ ::bind BwComboBox {Widget::destroy %W; rename %W {}}
+
+ proc ::ComboBox { path args } { return [eval ComboBox::create $path $args] }
+ proc use {} {}
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::create
+# ------------------------------------------------------------------------------
+proc ComboBox::create { path args } {
+ Widget::init ComboBox $path $args
+
+ frame $path -background [Widget::getoption $path -background] \
+ -highlightthickness 0 -bd 0 -relief flat -takefocus 0
+
+ bindtags $path [list $path BwComboBox [winfo toplevel $path] all]
+
+ set labf [eval LabelFrame::create $path.labf [Widget::subcget $path .labf] \
+ -focus $path.e]
+ set entry [eval Entry::create $path.e [Widget::subcget $path .e] \
+ -relief flat -borderwidth 0]
+
+ set width 11
+ set height [winfo reqheight $entry]
+ set arrow [eval ArrowButton::create $path.a [Widget::subcget $path .a] \
+ -width $width -height $height \
+ -highlightthickness 0 -borderwidth 1 -takefocus 0 \
+ -dir bottom \
+ -type button \
+ -command [list "ComboBox::_mapliste $path"]]
+
+ set frame [LabelFrame::getframe $labf]
+
+ pack $arrow -in $frame -side right -fill y
+ pack $entry -in $frame -side left -fill both -expand yes
+ pack $labf -fill x -expand yes
+
+ if { [Widget::getoption $path -editable] == 0 } {
+ ::bind $entry "ArrowButton::invoke $path.a"
+ } else {
+ ::bind $entry "ComboBox::_unmapliste $path"
+ }
+
+ ::bind $path "ComboBox::_unmapliste $path"
+ ::bind $entry "ComboBox::_modify_value $path previous"
+ ::bind $entry "ComboBox::_modify_value $path next"
+ ::bind $entry "ComboBox::_modify_value $path first"
+ ::bind $entry "ComboBox::_modify_value $path last"
+
+ rename $path ::$path:cmd
+ proc ::$path { cmd args } "return \[eval ComboBox::\$cmd $path \$args\]"
+
+ return $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::configure
+# ------------------------------------------------------------------------------
+proc ComboBox::configure { path args } {
+ set res [Widget::configure $path $args]
+
+ if { [Widget::hasChanged $path -values values] |
+ [Widget::hasChanged $path -height h] |
+ [Widget::hasChanged $path -font f] } {
+ destroy $path.shell.listb
+ }
+
+ if { [Widget::hasChanged $path -editable ed] } {
+ if { $ed } {
+ ::bind $path.e "ComboBox::_unmapliste $path"
+ } else {
+ ::bind $path.e "ArrowButton::invoke $path.a"
+ }
+ }
+
+ return $res
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::cget
+# ------------------------------------------------------------------------------
+proc ComboBox::cget { path option } {
+ Widget::setoption $path -text [Entry::cget $path.e -text]
+ return [Widget::cget $path $option]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::setvalue
+# ------------------------------------------------------------------------------
+proc ComboBox::setvalue { path index } {
+ set values [Widget::getoption $path -values]
+ set value [Entry::cget $path.e -text]
+ switch -- $index {
+ next {
+ if { [set idx [lsearch $values $value]] != -1 } {
+ incr idx
+ } else {
+ set idx [lsearch $values "$value*"]
+ }
+ }
+ previous {
+ if { [set idx [lsearch $values $value]] != -1 } {
+ incr idx -1
+ } else {
+ set idx [lsearch $values "$value*"]
+ }
+ }
+ first {
+ set idx 0
+ }
+ last {
+ set idx [expr {[llength $values]-1}]
+ }
+ default {
+ if { [string index $index 0] == "@" } {
+ set idx [string range $index 1 end]
+ if { [catch {string compare [expr {int($idx)}] $idx} res] || $res != 0 } {
+ return -code error "bad index \"$index\""
+ }
+ } else {
+ return -code error "bad index \"$index\""
+ }
+ }
+ }
+ if { $idx >= 0 && $idx < [llength $values] } {
+ set newval [lindex $values $idx]
+ Widget::setoption $path -text $newval
+ if { [set varname [Entry::cget $path.e -textvariable]] != "" } {
+ GlobalVar::setvar $varname $newval
+ } else {
+ Entry::configure $path.e -text $newval
+ }
+ return 1
+ }
+ return 0
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::getvalue
+# ------------------------------------------------------------------------------
+proc ComboBox::getvalue { path } {
+ set values [Widget::getoption $path -values]
+ set value [Entry::cget $path.e -text]
+
+ return [lsearch $values $value]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::bind
+# ------------------------------------------------------------------------------
+proc ComboBox::bind { path args } {
+ return [eval ::bind $path.e $args]
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::_create_popup
+# ------------------------------------------------------------------------------
+proc ComboBox::_create_popup { path } {
+ set shell [menu $path.shell -tearoff 0 -relief flat -bd 0]
+ wm overrideredirect $shell 1
+ wm withdraw $shell
+ wm transient $shell [winfo toplevel $path]
+ wm group $shell [winfo toplevel $path]
+ set lval [Widget::getoption $path -values]
+ set h [Widget::getoption $path -height]
+ set sb 0
+ if { $h <= 0 } {
+ set len [llength $lval]
+ if { $len < 3 } {
+ set h 3
+ } elseif { $len > 10 } {
+ set h 10
+ set sb 1
+ }
+ }
+ set frame [frame $shell.frame -relief sunken -bd 2]
+ set listb [listbox $shell.listb -relief flat -bd 0 -highlightthickness 0 \
+ -exportselection false \
+ -font [Widget::getoption $path -font] \
+ -height $h]
+
+ if { $sb } {
+ set scroll [scrollbar $shell.scroll \
+ -orient vertical \
+ -command "$shell.listb yview" \
+ -highlightthickness 0 -takefocus 0 -width 9]
+ $listb configure -yscrollcommand "$scroll set"
+ }
+ $listb delete 0 end
+ foreach val $lval {
+ $listb insert end $val
+ }
+
+ if { $sb } {
+ pack $scroll -in $frame -side right -fill y
+ }
+ pack $listb -in $frame -side left -fill both -expand yes
+ pack $frame -fill both -expand yes -padx 1 -padx 1
+
+ ::bind $listb "ComboBox::_select $path @%x,%y"
+ ::bind $listb "ComboBox::_select $path active"
+ ::bind $listb "ComboBox::_unmapliste $path"
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::_mapliste
+# ------------------------------------------------------------------------------
+proc ComboBox::_mapliste { path } {
+ set listb $path.shell.listb
+ if { [winfo exists $path.shell] } {
+ _unmapliste $path
+ return
+ }
+
+ if { [Widget::getoption $path -state] == "disabled" } {
+ return
+ }
+ if { [set cmd [Widget::getoption $path -postcommand]] != "" } {
+ uplevel \#0 $cmd
+ }
+ if { ![llength [Widget::getoption $path -values]] } {
+ return
+ }
+ _create_popup $path
+
+ ArrowButton::configure $path.a -dir top
+ $listb selection clear 0 end
+ set values [$listb get 0 end]
+ set curval [Entry::cget $path.e -text]
+ if { [set idx [lsearch $values $curval]] != -1 ||
+ [set idx [lsearch $values "$curval*"]] != -1 } {
+ $listb selection set $idx
+ $listb activate $idx
+ $listb see $idx
+ } else {
+ $listb activate 0
+ $listb see 0
+ }
+
+ set frame [LabelFrame::getframe $path.labf]
+ BWidget::place $path.shell [winfo width $frame] 0 below $frame
+ wm deiconify $path.shell
+ raise $path.shell
+ BWidget::grab global $path
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::_unmapliste
+# ------------------------------------------------------------------------------
+proc ComboBox::_unmapliste { path } {
+ BWidget::grab release $path
+ destroy $path.shell
+ ArrowButton::configure $path.a -dir bottom
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::_select
+# ------------------------------------------------------------------------------
+proc ComboBox::_select { path index } {
+ set index [$path.shell.listb index $index]
+ _unmapliste $path
+ if { $index != -1 } {
+ if { [setvalue $path @$index] } {
+ if { [set cmd [Widget::getoption $path -modifycmd]] != "" } {
+ uplevel \#0 $cmd
+ }
+ }
+ }
+ return -code break
+}
+
+
+# ------------------------------------------------------------------------------
+# Command ComboBox::_modify_value
+# ------------------------------------------------------------------------------
+proc ComboBox::_modify_value { path direction } {
+ if { [setvalue $path $direction] } {
+ if { [set cmd [Widget::getoption $path -modifycmd]] != "" } {
+ uplevel \#0 $cmd
+ }
+ }
+}
ADDED demo/basic.tcl
Index: demo/basic.tcl
==================================================================
--- /dev/null
+++ demo/basic.tcl
@@ -0,0 +1,199 @@
+
+namespace eval DemoBasic {
+ variable var
+ variable count 0
+ variable id ""
+}
+
+
+proc DemoBasic::create { nb } {
+ set frame [$nb insert end demoBasic -text "Basic"]
+
+ set topf [frame $frame.topf]
+ set titf1 [TitleFrame $topf.titf1 -text "Label"]
+ set titf2 [TitleFrame $topf.titf2 -text "Entry"]
+ set titf3 [TitleFrame $frame.titf3 -text "Button and ArrowButton"]
+
+ _label [$titf1 getframe]
+ _entry [$titf2 getframe]
+ _button [$titf3 getframe]
+
+ pack $titf1 $titf2 -side left -fill both -padx 4 -expand yes
+ pack $topf -pady 2 -fill x
+ pack $titf3 -pady 2 -padx 4 -fill x
+
+ return $frame
+}
+
+
+proc DemoBasic::_label { parent } {
+ variable var
+
+ set lab [Label $parent.label -text "This is a Label widget" \
+ -helptext "Label widget"]
+ set chk [checkbutton $parent.chk -text "Disabled" \
+ -variable DemoBasic::var($lab,-state) \
+ -onvalue disabled -offvalue normal \
+ -command "$lab configure -state \$DemoBasic::var($lab,-state)"]
+ pack $lab -anchor w -pady 4
+ pack $chk -anchor w
+}
+
+
+proc DemoBasic::_entry { parent } {
+ set ent [Entry $parent.entry -text "Press enter" \
+ -command {set DemoBasic::var(entcmd) "-command called"; after 500 {set DemoBasic::var(entcmd) ""}} \
+ -helptext "Entry widget"]
+ set chk1 [checkbutton $parent.chk1 -text "Disabled" \
+ -variable DemoBasic::var($ent,state) \
+ -onvalue disabled -offvalue normal \
+ -command "$ent configure -state \$DemoBasic::var($ent,state)"]
+ set chk2 [checkbutton $parent.chk2 -text "Non editable" \
+ -variable DemoBasic::var($ent,editable) \
+ -onvalue false -offvalue true \
+ -command "$ent configure -editable \$DemoBasic::var($ent,editable)"]
+ set lab [label $parent.cmd -textvariable DemoBasic::var(entcmd) -foreground red]
+ pack $ent -pady 4 -anchor w
+ pack $chk1 $chk2 -anchor w
+ pack $lab -pady 4
+}
+
+
+proc DemoBasic::_button { parent } {
+ variable var
+
+ set frame [frame $parent.butfr]
+ set but [Button $frame.but -text "Press me!" \
+ -repeatdelay 300 \
+ -command "DemoBasic::_butcmd command" \
+ -helptext "This is a Button widget"]
+ set sep1 [Separator $frame.sep1 -orient vertical]
+ set arr1 [ArrowButton $frame.arr1 -type button \
+ -width 25 -height 25 \
+ -repeatdelay 300 \
+ -command "DemoBasic::_butcmd command" \
+ -helptext "This is an ArrowButton widget\nof type button"]
+ set sep2 [Separator $frame.sep2 -orient vertical]
+ set arr2 [ArrowButton $frame.arr2 -type arrow \
+ -width 25 -height 25 -relief sunken -ipadx 0 -ipady 0 \
+ -repeatdelay 300 \
+ -command "DemoBasic::_butcmd command" \
+ -helptext "This is an ArrowButton widget\nof type arrow"]
+
+ pack $but -side left -padx 4
+ pack $sep1 -side left -padx 4 -fill y
+ pack $arr1 -side left -padx 4
+ pack $sep2 -side left -padx 4 -fill y
+ pack $arr2 -side left -padx 4
+ pack $frame
+
+ set sep3 [Separator $parent.sep3 -orient horizontal]
+ pack $sep3 -fill x -pady 10
+
+ set labf1 [LabelFrame $parent.labf1 -text "Command" -side top \
+ -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf1 getframe]
+ set chk1 [checkbutton $subf.chk1 -text "Disabled" \
+ -variable DemoBasic::var(bstate) -onvalue disabled -offvalue normal \
+ -command "DemoBasic::_bstate \$DemoBasic::var(bstate) $but $arr1 $arr2"]
+ set chk2 [checkbutton $subf.chk2 -text "Use -armcommand/\n-disarmcommand" \
+ -justify left \
+ -variable DemoBasic::var(barmcmd) \
+ -command "DemoBasic::_barmcmd \$DemoBasic::var(barmcmd) $but $arr1 $arr2"]
+ pack $chk1 $chk2 -anchor w
+
+ set label [label $parent.label -textvariable DemoBasic::var(butcmd) -foreground red]
+ pack $label -side bottom -pady 4
+
+ set labf2 [LabelFrame $parent.labf2 -text "Direction" -side top \
+ -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf2 getframe]
+ set var(bside) top
+ foreach dir {top left bottom right} {
+ set rad [radiobutton $subf.$dir -text "$dir arrow" \
+ -variable DemoBasic::var(bside) -value $dir \
+ -command "DemoBasic::_bside \$DemoBasic::var(bside) $arr1 $arr2"]
+ pack $rad -anchor w
+ }
+
+ set labf3 [LabelFrame $parent.labf3 -text "Relief" -side top \
+ -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf3 getframe]
+ set var(brelief) raised
+ foreach {f lrelief} {f1 {raised sunken ridge groove} f2 {flat solid link}} {
+ set f [frame $subf.$f]
+ foreach relief $lrelief {
+ set rad [radiobutton $f.$relief -text $relief \
+ -variable DemoBasic::var(brelief) -value $relief \
+ -command "DemoBasic::_brelief \$DemoBasic::var(brelief) $but $arr1 $arr2"]
+ pack $rad -anchor w
+ }
+ pack $f -side left -padx 2 -anchor n
+ }
+ pack $labf1 $labf2 $labf3 -side left -fill y -padx 4
+}
+
+
+proc DemoBasic::_bstate { state but arr1 arr2 } {
+ foreach but [list $but $arr1 $arr2] {
+ $but configure -state $state
+ }
+}
+
+
+proc DemoBasic::_brelief { relief but arr1 arr2 } {
+ $but configure -relief $relief
+ if { $relief != "link" } {
+ foreach arr [list $arr1 $arr2] {
+ $arr configure -relief $relief
+ }
+ }
+}
+
+
+proc DemoBasic::_bside { side args } {
+ foreach arr $args {
+ $arr configure -dir $side
+ }
+}
+
+
+proc DemoBasic::_barmcmd { value but arr1 arr2 } {
+ if { $value } {
+ $but configure \
+ -armcommand "DemoBasic::_butcmd arm" \
+ -disarmcommand "DemoBasic::_butcmd disarm" \
+ -command {}
+ foreach arr [list $arr1 $arr2] {
+ $arr configure \
+ -armcommand "DemoBasic::_butcmd arm" \
+ -disarmcommand "DemoBasic::_butcmd disarm" \
+ -command {}
+ }
+ } else {
+ $but configure -armcommand {} -disarmcommand {} \
+ -command "DemoBasic::_butcmd command"
+ foreach arr [list $arr1 $arr2] {
+ $arr configure -armcommand {} -disarmcommand {} \
+ -command "DemoBasic::_butcmd command"
+ }
+ }
+}
+
+
+proc DemoBasic::_butcmd { reason } {
+ variable count
+ variable id
+
+ catch {after cancel $id}
+ if { $reason == "arm" } {
+ incr count
+ set DemoBasic::var(butcmd) "$reason command called ($count)"
+ } else {
+ set count 0
+ set DemoBasic::var(butcmd) "$reason command called"
+ }
+ set id [after 500 {set DemoBasic::var(butcmd) ""}]
+}
+
+
ADDED demo/bwidget.xbm
Index: demo/bwidget.xbm
==================================================================
--- /dev/null
+++ demo/bwidget.xbm
@@ -0,0 +1,46 @@
+#define bwidget_width 76
+#define bwidget_height 64
+static char bwidget_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0xb6,0x6d,0xdb,0x16,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0xdb,0xb6,0x6d,0xab,0x00,0x00,0x00,0x00,0xf0,0x00,0x55,0x55,0x55,0x75,
+ 0x01,0x00,0x00,0x00,0xf0,0x00,0x6d,0xdb,0xb6,0xad,0x02,0x00,0x00,0x00,0xf0,
+ 0x00,0xb6,0x6d,0xdb,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0x55,0x55,0x55,0x55,
+ 0x05,0x00,0x00,0x00,0xf0,0x00,0xda,0xb6,0xad,0x6d,0x0b,0x00,0x00,0x00,0xf0,
+ 0x00,0x6b,0x03,0xc0,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0x56,0x05,0x00,0x55,
+ 0x0d,0x00,0x00,0x00,0xf0,0x00,0xbb,0x05,0x80,0xdb,0x06,0x00,0x00,0x00,0xf0,
+ 0x00,0xca,0x06,0x00,0x6c,0x0b,0x00,0x00,0x00,0xf0,0x00,0xb6,0x02,0x00,0xaa,
+ 0x0a,0x00,0x00,0x00,0xf0,0x00,0xab,0x05,0x00,0x6c,0x0b,0x00,0x00,0x00,0xf0,
+ 0x00,0xdd,0x06,0x00,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0xaa,0x02,0x00,0x55,
+ 0x05,0x00,0x00,0x00,0xf0,0x00,0xb7,0x05,0xc0,0xda,0x02,0x00,0x00,0x00,0xf0,
+ 0x00,0xd9,0x06,0x50,0x6b,0x01,0x00,0x00,0x00,0xf0,0x00,0x56,0xb5,0xad,0xad,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0xdb,0xd6,0x76,0x15,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x6a,0xab,0xaa,0x2d,0x00,0x00,0x00,0x00,0xf0,0x00,0x56,0x75,0xad,0xb6,
+ 0x02,0x00,0x00,0x00,0xf0,0x00,0xbb,0xad,0xd6,0xaa,0x05,0x00,0x00,0x00,0xf0,
+ 0x00,0xca,0xb6,0x6b,0xdb,0x2a,0x00,0x00,0x00,0xf0,0x00,0x77,0xd5,0x5c,0x6d,
+ 0x2d,0x00,0x00,0x00,0xf0,0x00,0x99,0x05,0x00,0xaa,0x56,0x00,0x00,0x00,0xf0,
+ 0x00,0xee,0x06,0x00,0x6c,0xbb,0x00,0x00,0x00,0xf0,0x00,0xaa,0x02,0x00,0xb0,
+ 0x55,0x00,0x00,0x00,0xf0,0x00,0x55,0x05,0x00,0xa8,0xd6,0x00,0x00,0x00,0xf0,
+ 0x00,0xee,0x06,0x00,0xd0,0x6a,0x00,0x00,0x00,0xf0,0x00,0x55,0x03,0x00,0x68,
+ 0xb7,0xfc,0x00,0x7e,0xf0,0x00,0x6d,0x05,0x00,0xa8,0xaa,0xfc,0x80,0x7e,0xf0,
+ 0x00,0xb6,0x05,0x00,0x50,0xbb,0xfe,0x01,0x7e,0xf0,0x00,0x55,0x05,0x00,0x78,
+ 0xad,0xfe,0x81,0x1f,0xf0,0x00,0xb6,0x05,0x00,0xa4,0xb5,0xfe,0x81,0x1f,0xf0,
+ 0x00,0x5b,0x05,0x80,0xba,0x56,0xfe,0x83,0x1f,0xf0,0x00,0xaa,0x6b,0x5b,0xd5,
+ 0x5a,0xff,0x85,0x1f,0xf0,0x00,0xdb,0x5a,0xad,0x57,0x2b,0xff,0xc7,0x0f,0xf0,
+ 0x00,0x6d,0xad,0xd5,0x6a,0x0d,0xff,0xc7,0x0f,0xf0,0x00,0xaa,0xd6,0xb6,0xba,
+ 0x05,0xdf,0xc7,0x0f,0xf0,0x00,0xb7,0xb5,0x5a,0xab,0x8a,0xdf,0xcf,0x0f,0xf0,
+ 0x00,0xd9,0x5a,0xab,0x6d,0x8f,0xcf,0xef,0x07,0xf0,0x00,0x56,0xad,0x75,0xb5,
+ 0xaf,0x8f,0xef,0x07,0xf0,0x00,0xb5,0xeb,0x5a,0x00,0x9f,0xcf,0xef,0x07,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xff,0x8f,0xff,0x07,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x87,0xff,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,0xff,0x03,0xff,0x03,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0xff,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfe,0x03,0xff,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0xfc,0x01,0xff,0x03,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0xfe,0x01,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0xfc,0x01,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0};
ADDED demo/demo.tcl
Index: demo/demo.tcl
==================================================================
--- /dev/null
+++ demo/demo.tcl
@@ -0,0 +1,203 @@
+
+
+source manager.tcl
+source basic.tcl
+source select.tcl
+source dnd.tcl
+source tree.tcl
+source tmpldlg.tcl
+
+
+namespace eval Demo {
+ variable _wfont
+
+ variable notebook
+ variable mainframe
+ variable status
+ variable prgtext
+ variable prgindic
+ variable font
+ variable font_name
+ variable toolbar1 1
+ variable toolbar2 1
+}
+
+
+proc Demo::create { } {
+ global tcl_platform
+ global tk_patchLevel
+ variable _wfont
+ variable notebook
+ variable mainframe
+ variable font
+ variable prgtext
+ variable prgindic
+
+ set prgtext "Please wait while loading font..."
+ set prgindic -1
+ _create_intro
+ update
+ SelectFont::loadfont
+
+ # Menu description
+ set descmenu {
+ "&File" all file 0 {
+ {command "E&xit" {} "Exit BWidget demo" {} -command exit}
+ }
+ "&Options" all options 0 {
+ {checkbutton "Toolbar &1" {all option} "Show/hide toolbar 1" {}
+ -variable Demo::toolbar1
+ -command {$Demo::mainframe showtoolbar 0 $Demo::toolbar1}
+ }
+ {checkbutton "Toolbar &2" {all option} "Show/hide toolbar 2" {}
+ -variable Demo::toolbar2
+ -command {$Demo::mainframe showtoolbar 1 $Demo::toolbar2}
+ }
+ }
+ }
+
+ set prgtext "Creating MainFrame..."
+ set prgindic 0
+ set mainframe [MainFrame .mainframe \
+ -menu $descmenu \
+ -textvariable Demo::status \
+ -progressvar Demo::prgindic]
+
+ # toolbar 1 creation
+ incr prgindic
+ set tb1 [$mainframe addtoolbar]
+ set bbox [ButtonBox $tb1.bbox1 -spacing 0 -padx 1 -pady 1]
+ $bbox add -image [Bitmap::get new] \
+ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
+ -helptext "Create a new file"
+ $bbox add -image [Bitmap::get open] \
+ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
+ -helptext "Open an existing file"
+ $bbox add -image [Bitmap::get save] \
+ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
+ -helptext "Save file"
+ pack $bbox -side left -anchor w
+
+ set sep [Separator $tb1.sep -orient vertical]
+ pack $sep -side left -fill y -padx 4 -anchor w
+
+ incr prgindic
+ set bbox [ButtonBox $tb1.bbox2 -spacing 0 -padx 1 -pady 1]
+ $bbox add -image [Bitmap::get cut] \
+ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
+ -helptext "Cut selection"
+ $bbox add -image [Bitmap::get copy] \
+ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
+ -helptext "Copy selection"
+ $bbox add -image [Bitmap::get paste] \
+ -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
+ -helptext "Paste selection"
+ pack $bbox -side left -anchor w
+
+ # toolbar 2 creation
+ incr prgindic
+ set tb2 [$mainframe addtoolbar]
+ set _wfont [SelectFont $tb2.font -type toolbar \
+ -command "Demo::update_font \[$tb2.font cget -font\]"]
+ set font [$_wfont cget -font]
+ pack $_wfont -side left -anchor w
+
+ $mainframe addindicator -text "BWidget [package version BWidget]"
+ $mainframe addindicator -textvariable tk_patchLevel
+
+ # NoteBook creation
+ set frame [$mainframe getframe]
+ set notebook [NoteBook $frame.nb]
+
+ set prgtext "Creating Manager..."
+ incr prgindic
+ set f0 [DemoManager::create $notebook]
+ set prgtext "Creating Basic..."
+ incr prgindic
+ set f1 [DemoBasic::create $notebook]
+ set prgtext "Creating Select..."
+ incr prgindic
+ set f2 [DemoSelect::create $notebook]
+ set prgtext "Creating Dialog..."
+ incr prgindic
+ set f3b [DemoDlg::create $notebook]
+ set prgtext "Creating Drag and Drop..."
+ incr prgindic
+ set f4 [DemoDnd::create $notebook]
+ set prgtext "Creating Tree..."
+ incr prgindic
+ set f5 [DemoTree::create $notebook]
+
+ set prgtext "Done"
+ incr prgindic
+ $notebook compute_size
+ pack $notebook -fill both -expand yes -padx 4 -pady 4
+ $notebook raise [$notebook page 0]
+
+ pack $mainframe -fill both -expand yes
+ update idletasks
+ destroy .intro
+}
+
+
+proc Demo::update_font { newfont } {
+ variable _wfont
+ variable notebook
+ variable font
+ variable font_name
+
+ . configure -cursor watch
+ if { $font != $newfont } {
+ $_wfont configure -font $newfont
+ $notebook configure -font $newfont
+ set font $newfont
+ }
+ . configure -cursor ""
+}
+
+
+proc Demo::_create_intro { } {
+ global tcl_platform
+
+ set top [toplevel .intro -relief raised -borderwidth 2]
+
+ wm withdraw $top
+ wm overrideredirect $top 1
+
+ set ximg [label $top.x -bitmap @x1.xbm -foreground grey90 -background white]
+ set bwimg [label $ximg.bw -bitmap @bwidget.xbm -foreground grey90 -background white]
+ set frame [frame $ximg.f -background white]
+ set lab1 [label $frame.lab1 -text "Loading demo" -background white -font {times 8}]
+ set lab2 [label $frame.lab2 -textvariable Demo::prgtext -background white -font {times 8} -width 35]
+ set prg [ProgressBar $frame.prg -width 50 -height 10 -background white \
+ -variable Demo::prgindic -maximum 10]
+ pack $lab1 $lab2 $prg
+ place $frame -x 0 -y 0 -anchor nw
+ place $bwimg -relx 1 -rely 1 -anchor se
+ pack $ximg
+ BWidget::place $top 0 0 center
+ wm deiconify $top
+}
+
+
+proc main {} {
+ global tcl_platform
+ global auto_path
+
+ lappend auto_path ..
+ package require BWidget
+
+ option add *TitleFrame.font {helvetica 11 bold italic}
+
+ wm withdraw .
+ wm title . "BWidget demo"
+
+ Demo::create
+ BWidget::place . 0 0 center
+ wm deiconify .
+ raise .
+ focus -force .
+}
+
+main
+wm geom . [wm geom .]
ADDED demo/dnd.tcl
Index: demo/dnd.tcl
==================================================================
--- /dev/null
+++ demo/dnd.tcl
@@ -0,0 +1,42 @@
+
+namespace eval DemoDnd {
+}
+
+
+proc DemoDnd::create { nb } {
+
+ set frame [$nb insert end demoDnd -text "Drag and Drop"]
+
+ set titf1 [TitleFrame $frame.titf1 -text "Drag sources"]
+ set subf [$titf1 getframe]
+
+ set ent1 [LabelEntry $subf.e1 -label "Entry" -labelwidth 14 -dragenabled 1 -dragevent 3]
+ set labf1 [LabelFrame $subf.f1 -text "Label (text)" -width 14]
+ set f [$labf1 getframe]
+ set lab [Label $f.l -text "Drag this text" -dragenabled 1 -dragevent 3]
+ pack $lab
+
+ set labf2 [LabelFrame $subf.f2 -text "Label (bitmap)" -width 14]
+ set f [$labf2 getframe]
+ set lab [Label $f.l -bitmap info -dragenabled 1 -dragevent 3]
+ pack $lab
+
+ pack $ent1 $labf1 $labf2 -side top -fill x -pady 4
+
+ set titf2 [TitleFrame $frame.titf2 -text "Drop targets"]
+ set subf [$titf2 getframe]
+
+ set ent1 [LabelEntry $subf.e1 -label "Entry" -labelwidth 14 -dropenabled 1]
+ set labf1 [LabelFrame $subf.f1 -text "Label" -width 14]
+ set f [$labf1 getframe]
+ set lab [Label $f.l -dropenabled 1 -highlightthickness 1]
+ pack $lab -fill x
+
+ pack $ent1 $labf1 -side top -fill x -pady 4
+
+ pack $titf1 $titf2 -pady 4
+
+ return $frame
+}
+
+
ADDED demo/manager.tcl
Index: demo/manager.tcl
==================================================================
--- /dev/null
+++ demo/manager.tcl
@@ -0,0 +1,141 @@
+
+
+namespace eval DemoManager {
+ variable _progress 0
+ variable _afterid ""
+ variable _status "Compute in progress..."
+ variable _homogeneous 0
+}
+
+
+proc DemoManager::create { nb } {
+ set frame [$nb insert end demoManager -text "Manager"]
+
+ set topf [frame $frame.topf]
+ set titf1 [TitleFrame $topf.titf1 -text "MainFrame"]
+ set titf2 [TitleFrame $topf.titf2 -text "NoteBook"]
+ set titf3 [TitleFrame $frame.titf3 -text "Paned & ScrolledWindow"]
+
+ _mainframe [$titf1 getframe]
+ _notebook [$titf2 getframe]
+ _paned [$titf3 getframe]
+
+ pack $titf1 $titf2 -padx 4 -side left -fill both -expand yes
+ pack $topf -fill x -pady 2
+ pack $titf3 -pady 2 -padx 4 -fill both -expand yes
+
+ return $frame
+}
+
+
+proc DemoManager::_mainframe { parent } {
+ set labf1 [LabelFrame $parent.labf1 -text "Toolbar" -side top -anchor w \
+ -relief sunken -borderwidth 2]
+ set subf [$labf1 getframe]
+ checkbutton $subf.chk1 -text "View toolbar 1" -variable Demo::toolbar1 \
+ -command {$Demo::mainframe showtoolbar 0 $Demo::toolbar1}
+ checkbutton $subf.chk2 -text "View toolbar 2" -variable Demo::toolbar2 \
+ -command {$Demo::mainframe showtoolbar 1 $Demo::toolbar2}
+ pack $subf.chk1 $subf.chk2 -anchor w -fill x
+ pack $labf1 -fill both
+
+ set labf2 [LabelFrame $parent.labf2 -text "Status bar" -side top -anchor w \
+ -relief sunken -borderwidth 2]
+ set subf [$labf2 getframe]
+ checkbutton $subf.chk1 -text "Show Progress\nindicator" -justify left \
+ -variable DemoManager::_progress \
+ -command {DemoManager::_show_progress}
+ pack $subf.chk1 -anchor w -fill x
+
+ pack $labf1 $labf2 -side left -padx 4 -fill both
+}
+
+
+proc DemoManager::_notebook { parent } {
+ checkbutton $parent.chk1 -text "Homogeneous label" \
+ -variable DemoManager::_homogeneous \
+ -command {$Demo::notebook configure -homogeneous $DemoManager::_homogeneous}
+ pack $parent.chk1 -side left -anchor n -fill x
+}
+
+
+
+proc DemoManager::_paned { parent } {
+ set pw1 [PanedWindow $parent.pw -side top]
+ set pane [$pw1 add -minsize 100]
+
+ set pw2 [PanedWindow $pane.pw -side left]
+ set pane1 [$pw2 add -minsize 100]
+ set pane2 [$pw2 add -minsize 100]
+ set pane3 [$pw1 add -minsize 100]
+
+ foreach pane [list $pane1 $pane2] {
+ set sw [ScrolledWindow $pane.sw]
+ set lb [listbox $sw.lb -height 8 -width 20 -highlightthickness 0]
+ for {set i 1} {$i <= 8} {incr i} {
+ $lb insert end "Value $i"
+ }
+ $sw setwidget $lb
+ pack $sw -fill both -expand yes
+ }
+
+ set sw [ScrolledWindow $pane3.sw -relief sunken -borderwidth 2]
+ set sf [ScrollableFrame $sw.f]
+ $sw setwidget $sf
+ set subf [$sf getframe]
+ set lab [label $subf.lab -text "This is a ScrollableFrame"]
+ set chk [checkbutton $subf.chk -text "Constrained width" \
+ -variable DemoManager::_constw \
+ -command "$sf configure -constrainedwidth \$DemoManager::_constw"]
+ pack $lab
+ pack $chk -anchor w
+ bind $chk "$sf see $chk"
+ for {set i 0} {$i <= 20} {incr i} {
+ pack [entry $subf.ent$i -width 50] -fill x -pady 4
+ bind $subf.ent$i "$sf see $subf.ent$i"
+ $subf.ent$i insert end "Text field $i"
+ }
+
+ pack $sw $pw2 $pw1 -fill both -expand yes
+}
+
+
+proc DemoManager::_show_progress { } {
+ variable _progress
+ variable _afterid
+ variable _status
+
+ if { $_progress } {
+ set Demo::status "Compute in progress..."
+ set Demo::prgindic 0
+ $Demo::mainframe showstatusbar progression
+ if { $_afterid == "" } {
+ set _afterid [after 30 DemoManager::_update_progress]
+ }
+ } else {
+ set Demo::status ""
+ $Demo::mainframe showstatusbar status
+ set _afterid ""
+ }
+}
+
+
+proc DemoManager::_update_progress { } {
+ variable _progress
+ variable _afterid
+
+ if { $_progress } {
+ if { $Demo::prgindic < 100 } {
+ incr Demo::prgindic 5
+ set _afterid [after 30 DemoManager::_update_progress]
+ } else {
+ set _progress 0
+ $Demo::mainframe showstatusbar status
+ set Demo::status "Done"
+ set _afterid ""
+ after 500 {set Demo::status ""}
+ }
+ } else {
+ set _afterid ""
+ }
+}
ADDED demo/select.tcl
Index: demo/select.tcl
==================================================================
--- /dev/null
+++ demo/select.tcl
@@ -0,0 +1,61 @@
+namespace eval DemoSelect {
+ variable var
+}
+
+
+proc DemoSelect::create { nb } {
+ set frame [$nb insert end demoSelect -text "Spin & Combo"]
+
+ set titf1 [TitleFrame $frame.titf1 -text SpinBox]
+ set subf [$titf1 getframe]
+ set spin [SpinBox $subf.spin -label "spinbox" -underline 0 \
+ -labelwidth 10 -labelanchor w \
+ -range {1 100 1} -textvariable DemoSelect::var(spin,var) \
+ -helptext "This is the SpinBox"]
+ set ent [LabelEntry $subf.ent -label "Linked var" -labelwidth 10 -labelanchor w \
+ -textvariable DemoSelect::var(spin,var) -editable 0 \
+ -helptext "This is an Entry reflecting\nthe linked var of SpinBox"]
+ set labf [LabelFrame $subf.options -text "Options" -side top -anchor w \
+ -relief sunken -borderwidth 1 \
+ -helptext "Modify some options of SpinBox"]
+ set subf [$labf getframe]
+ set chk1 [checkbutton $subf.chk1 -text "Non editable" \
+ -variable DemoSelect::var(spin,editable) -onvalue false -offvalue true \
+ -command "$spin configure -editable \$DemoSelect::var(spin,editable)"]
+ set chk2 [checkbutton $subf.chk2 -text "Disabled" \
+ -variable DemoSelect::var(spin,state) -onvalue disabled -offvalue normal \
+ -command "$spin configure -state \$DemoSelect::var(spin,state)"]
+
+ pack $chk1 $chk2 -side left -anchor w
+ pack $spin $ent $labf -pady 4 -fill x
+ pack $titf1
+
+ set titf2 [TitleFrame $frame.titf2 -text ComboBox]
+ set subf [$titf2 getframe]
+ set combo [ComboBox $subf.combo -label "combobox" -underline 0 \
+ -labelwidth 10 -labelanchor w \
+ -textvariable DemoSelect::var(combo,var) \
+ -values {"first value" "second value" "third value" "fourth value" "fifth value"} \
+ -helptext "This is the ComboBox"]
+ set ent [LabelEntry $subf.ent -label "Linked var" -labelwidth 10 -labelanchor w \
+ -textvariable DemoSelect::var(combo,var) -editable 0 \
+ -helptext "This is an Entry reflecting\nthe linked var of ComboBox"]
+ set labf [LabelFrame $subf.options -text "Options" -side top -anchor w \
+ -relief sunken -borderwidth 1 \
+ -helptext "Modify some options of SpinBox"]
+ set subf [$labf getframe]
+ set chk1 [checkbutton $subf.chk1 -text "Non editable" \
+ -variable DemoSelect::var(combo,editable) -onvalue false -offvalue true \
+ -command "$combo configure -editable \$DemoSelect::var(combo,editable)"]
+ set chk2 [checkbutton $subf.chk2 -text "Disabled" \
+ -variable DemoSelect::var(combo,state) -onvalue disabled -offvalue normal \
+ -command "$combo configure -state \$DemoSelect::var(combo,state)"]
+
+ pack $chk1 $chk2 -side left -anchor w
+ pack $combo $ent $labf -pady 4 -fill x
+
+ pack $titf1 $titf2 -pady 4
+
+ return $frame
+}
+
ADDED demo/tmpldlg.tcl
Index: demo/tmpldlg.tcl
==================================================================
--- /dev/null
+++ demo/tmpldlg.tcl
@@ -0,0 +1,207 @@
+
+namespace eval DemoDlg {
+ variable tmpl
+ variable msg
+ variable progmsg
+ variable progval
+ variable resources "en"
+}
+
+
+proc DemoDlg::create { nb } {
+ set frame [$nb insert end demoDlg -text "Dialog"]
+
+ set titf1 [TitleFrame $frame.titf1 -text "Resources"]
+ set titf2 [TitleFrame $frame.titf2 -text "Template Dialog"]
+ set titf3 [TitleFrame $frame.titf3 -text "Message Dialog"]
+ set titf4 [TitleFrame $frame.titf4 -text "Other dialog"]
+
+ set subf [$titf1 getframe]
+ set cmd {option read [file join $env(BWIDGET_LIBRARY) "lang" $DemoDlg::resources.rc]}
+ set rad1 [radiobutton $subf.rad1 -text "English" \
+ -variable DemoDlg::resources -value en \
+ -command $cmd]
+ set rad2 [radiobutton $subf.rad2 -text "French" \
+ -variable DemoDlg::resources -value fr \
+ -command $cmd]
+ set rad3 [radiobutton $subf.rad3 -text "German" \
+ -variable DemoDlg::resources -value de \
+ -command $cmd]
+ pack $rad1 $rad2 $rad3 -side left
+
+ _tmpldlg [$titf2 getframe]
+ _msgdlg [$titf3 getframe]
+ _stddlg [$titf4 getframe]
+
+ pack $titf1 -fill x -pady 2 -padx 2
+ pack $titf4 -side bottom -fill x -pady 2 -padx 2
+ pack $titf2 $titf3 -side left -padx 2 -fill both -expand yes
+}
+
+
+proc DemoDlg::_tmpldlg { parent } {
+ variable tmpl
+
+ set tmpl(side) bottom
+ set tmpl(anchor) c
+
+ set labf1 [LabelFrame $parent.labf1 -text "Button side" -side top \
+ -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf1 getframe]
+ radiobutton $subf.rad1 -text "Bottom" \
+ -variable DemoDlg::tmpl(side) -value bottom -anchor w
+ radiobutton $subf.rad2 -text "Left" \
+ -variable DemoDlg::tmpl(side) -value left -anchor w
+ radiobutton $subf.rad3 -text "Right" \
+ -variable DemoDlg::tmpl(side) -value right -anchor w
+ radiobutton $subf.rad4 -text "Top" \
+ -variable DemoDlg::tmpl(side) -value top -anchor w
+
+ pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 -fill x -anchor w
+
+ set labf2 [LabelFrame $parent.labf2 -text "Button anchor" -side top \
+ -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf2 getframe]
+ radiobutton $subf.rad1 -text "North" \
+ -variable DemoDlg::tmpl(anchor) -value n -anchor w
+ radiobutton $subf.rad2 -text "West" \
+ -variable DemoDlg::tmpl(anchor) -value w -anchor w
+ radiobutton $subf.rad3 -text "East" \
+ -variable DemoDlg::tmpl(anchor) -value e -anchor w
+ radiobutton $subf.rad4 -text "South" \
+ -variable DemoDlg::tmpl(anchor) -value s -anchor w
+ radiobutton $subf.rad5 -text "Center" \
+ -variable DemoDlg::tmpl(anchor) -value c -anchor w
+
+ pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 $subf.rad5 -fill x -anchor w
+
+ set sep [Separator $parent.sep -orient horizontal]
+ set button [button $parent.but -text "Show" -command DemoDlg::_show_tmpldlg]
+
+ pack $button -side bottom
+ pack $sep -side bottom -fill x -pady 10
+ pack $labf1 $labf2 -side left -padx 4 -anchor n
+}
+
+
+proc DemoDlg::_msgdlg { parent } {
+ variable msg
+
+ set msg(type) ok
+ set msg(icon) info
+
+ set labf1 [LabelFrame $parent.labf1 -text "Type" -side top \
+ -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf1 getframe]
+ radiobutton $subf.rad1 -text "Ok" -variable DemoDlg::msg(type) -value ok -anchor w
+ radiobutton $subf.rad2 -text "Ok, Cancel" -variable DemoDlg::msg(type) -value okcancel -anchor w
+ radiobutton $subf.rad3 -text "Retry, Cancel" -variable DemoDlg::msg(type) -value retrycancel -anchor w
+ radiobutton $subf.rad4 -text "Yes, No" -variable DemoDlg::msg(type) -value yesno -anchor w
+ radiobutton $subf.rad5 -text "Yes, No, Cancel" -variable DemoDlg::msg(type) -value yesnocancel -anchor w
+ radiobutton $subf.rad6 -text "Abort, Retry, Ignore" -variable DemoDlg::msg(type) -value abortretryignore -anchor w
+ radiobutton $subf.rad7 -text "User" -variable DemoDlg::msg(type) -value user -anchor w
+ Entry $subf.user -textvariable DemoDlg::msg(buttons)
+
+ pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 $subf.rad5 $subf.rad6 -fill x -anchor w
+ pack $subf.rad7 $subf.user -side left
+
+ set labf2 [LabelFrame $parent.labf2 -text "Icon" -side top -anchor w -relief sunken -borderwidth 1]
+ set subf [$labf2 getframe]
+ radiobutton $subf.rad1 -text "Information" -variable DemoDlg::msg(icon) -value info -anchor w
+ radiobutton $subf.rad2 -text "Question" -variable DemoDlg::msg(icon) -value question -anchor w
+ radiobutton $subf.rad3 -text "Warning" -variable DemoDlg::msg(icon) -value warning -anchor w
+ radiobutton $subf.rad4 -text "Error" -variable DemoDlg::msg(icon) -value error -anchor w
+ pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 -fill x -anchor w
+
+
+ set sep [Separator $parent.sep -orient horizontal]
+ set button [button $parent.but -text "Show" -command DemoDlg::_show_msgdlg]
+
+ pack $button -side bottom
+ pack $sep -side bottom -fill x -pady 10
+ pack $labf1 $labf2 -side left -padx 4 -anchor n
+}
+
+
+proc DemoDlg::_stddlg { parent } {
+ set labf [LabelFrame $parent.f -text "Select a color "]
+ set color [SelectColor [$labf getframe].col -type menubutton]
+ set but1 [button $parent.but1 \
+ -text "Font selector dialog" \
+ -command DemoDlg::_show_fontdlg]
+ set but2 [button $parent.but2 \
+ -text "Progression dialog" \
+ -command DemoDlg::_show_progdlg]
+ set but3 [button $parent.but3 \
+ -text "Password dialog" \
+ -command DemoDlg::_show_passdlg]
+
+ pack $color
+ pack $labf $but1 $but2 $but3 -side left -padx 5 -anchor w
+}
+
+
+proc DemoDlg::_show_tmpldlg { } {
+ variable tmpl
+
+ set dlg [Dialog .tmpldlg -parent . -modal local \
+ -separator 1 \
+ -title "Template dialog" \
+ -side $tmpl(side) \
+ -anchor $tmpl(anchor) \
+ -default 0 -cancel 1]
+ $dlg add -name ok
+ $dlg add -name cancel
+ set msg [message [$dlg getframe].msg -text "Template\nDialog" -justify center -anchor c]
+ pack $msg -fill both -expand yes -padx 100 -pady 100
+ $dlg draw
+ destroy $dlg
+}
+
+
+proc DemoDlg::_show_msgdlg { } {
+ variable msg
+
+ destroy .msgdlg
+ MessageDlg .msgdlg -parent . \
+ -message "Message for MessageBox" \
+ -type $msg(type) \
+ -icon $msg(icon) \
+ -buttons $msg(buttons)
+}
+
+
+proc DemoDlg::_show_fontdlg { } {
+ set font [SelectFont .fontdlg -parent . -font $Demo::font]
+ if { $font != "" } {
+ Demo::update_font $font
+ }
+}
+
+
+proc DemoDlg::_show_progdlg { } {
+ set DemoDlg::progmsg "Compute in progress..."
+ set DemoDlg::progval 0
+
+ ProgressDlg .progress -parent . -title "Wait..." \
+ -type infinite \
+ -width 20 \
+ -textvariable DemoDlg::progmsg \
+ -variable DemoDlg::progval \
+ -stop "Stop" \
+ -command {destroy .progress}
+ _update_progdlg
+}
+
+
+proc DemoDlg::_update_progdlg { } {
+ if { [winfo exists .progress] } {
+ set DemoDlg::progval 2
+ after 20 DemoDlg::_update_progdlg
+ }
+}
+
+proc DemoDlg::_show_passdlg { } {
+ PasswdDlg .passwd -parent .
+}
+
ADDED demo/tree.tcl
Index: demo/tree.tcl
==================================================================
--- /dev/null
+++ demo/tree.tcl
@@ -0,0 +1,254 @@
+
+namespace eval DemoTree {
+ variable count
+ variable dblclick
+}
+
+
+proc DemoTree::create { nb } {
+ set frame [$nb insert end demoTree -text "Tree"]
+ set pw [PanedWindow $frame.pw -side top]
+
+ set pane [$pw add -weight 1]
+ set title [TitleFrame $pane.lf -text "Directory tree"]
+ set sw [ScrolledWindow [$title getframe].sw \
+ -relief sunken -borderwidth 2]
+ set tree [Tree $sw.tree \
+ -relief flat -borderwidth 0 -width 15 -highlightthickness 0\
+ -redraw 0 -dropenabled 1 -dragenabled 1 \
+ -dragevent 3 \
+ -droptypes {
+ TREE_NODE {copy {} move {} link {}}
+ LISTBOX_ITEM {copy {} move {} link {}}
+ } \
+ -opencmd "DemoTree::moddir 1 $sw.tree" \
+ -closecmd "DemoTree::moddir 0 $sw.tree"]
+ $sw setwidget $tree
+
+ pack $sw -side top -expand yes -fill both
+ pack $title -fill both -expand yes
+
+ set pane [$pw add -weight 2]
+ set lf [TitleFrame $pane.lf -text "Content"]
+ set sw [ScrolledWindow [$lf getframe].sw \
+ -scrollbar horizontal -auto none -relief sunken -borderwidth 2]
+ set list [ListBox::create $sw.lb \
+ -relief flat -borderwidth 0 \
+ -dragevent 3 \
+ -dropenabled 1 -dragenabled 1 \
+ -width 20 -highlightthickness 0 -multicolumn true \
+ -redraw 0 -dragenabled 1 \
+ -droptypes {
+ TREE_NODE {copy {} move {} link {}}
+ LISTBOX_ITEM {copy {} move {} link {}}}]
+ $sw setwidget $list
+
+ pack $sw $lf -fill both -expand yes
+
+ pack $pw -fill both -expand yes
+
+ $tree bindText "DemoTree::select tree 1 $tree $list"
+ $tree bindText "DemoTree::select tree 2 $tree $list"
+ $list bindText "DemoTree::select list 1 $tree $list"
+ $list bindText "DemoTree::select list 2 $tree $list"
+ $list bindImage "DemoTree::select list 2 $tree $list"
+
+ $nb itemconfigure demoTree \
+ -createcmd "DemoTree::init $tree $list" \
+ -raisecmd {
+ regexp {[0-9]+x[0-9]+([+-][0-9]+)([+-][0-9]+)} [wm geom .] \
+ global_foo global_w global_h
+ BWidget::place .top 0 0 at [expr {$global_w-[winfo screenwidth .]}] $global_h
+ wm deiconify .top
+ bind . {wm withdraw .top}
+ bind .