Under construction ...
NAME
Widget - The Widget base class
COMMAND
Widget::addmap class subclass subpath options
Widget::bwinclude class subclass subpath ?arg...?
Widget::cget path option
Widget::configure path options
Widget::declare class optlist
Widget::destroy path
Widget::focusNext w
Widget::focusOK w
Widget::focusPrev w
Widget::generate-doc dir widgetlist
Widget::generate-widget-doc class iscmd file
Widget::getoption path option
Widget::hasChanged path option pvalue
Widget::init class path options
Widget::setoption path option value
Widget::subcget path subwidget
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:

namespace eval ComboBox {
    # We're using ArrowButton, Entry and LabelFrame
    ArrowButton::use
    Entry::use
    LabelFrame::use

    # Include resources of LabelFrame
    Widget::bwinclude ComboBox LabelFrame .labf \ 
        rename     {-text -label} \ 
        remove     {-focus} \ 
        prefix     {label -justify -width -anchor -height -font} \ 
        initialize {-relief sunken -borderwidth 2}

    # Include resources of Entry
    Widget::bwinclude ComboBox Entry .e \ 
        remove {-relief -bd -borderwidth -bg -fg} \ 
        rename {-foreground -entryfg -background -entrybg}

    # Declare new resources
    Widget::declare ComboBox {
        {-height      TkResource 0  0 listbox}
        {-values      String     "" 0}
        {-modifycmd   String     "" 0}
        {-postcommand String     "" 0}
    }

    # Map resources to subwidget
    Widget::addmap ComboBox "" :cmd {-background {}}
    Widget::addmap ComboBox ArrowButton .a \ 
        {-foreground {} -background {} -disabledforeground {} -state {}}

    # Synchronize subwidget options
    Widget::syncoptions ComboBox Entry .e {-text {}}
    Widget::syncoptions ComboBox LabelFrame .labf {-label -text -underline {}}

    proc use {} {}
}



COMMAND
Widget::addmap class subclass subpath options
This command map some resources to subwidget. Mapped resources automatically configure subwidget when widget is configured.
Widget::bwinclude class subclass subpath ?arg...?
This command includes into a new BWidget the resources of another BWidget. Arguments are:
Widget::cget path option
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.
Widget::configure path options
Description text
Widget::declare class optlist
This command declare new resources for a BWidget.
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.
Widget::destroy path
Description text
Widget::focusNext w
Description text
Widget::focusOK w
Description text
Widget::focusPrev w
Description text
Widget::generate-doc dir widgetlist
Description text
Widget::generate-widget-doc class iscmd file
Description text
Widget::getoption path option
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.
Widget::hasChanged path option pvalue
Description text
Widget::init class path options
Description text
Widget::setoption path option value
Set the value of option of BWidget path without option test, subwidget mapping, synonym handling and does not set the modification flag.
Widget::subcget path subwidget
Returns the list of all option/value of BWidget path that are mapped to subwidget.
Widget::syncoptions class subclass subpath options
This command synchronize options value of a subwidget. Used when an option of a subwidget is modified out of the BWidget configure command.
Widget::tkinclude class tkwidget subpath ?arg...?
This command includes into a new BWidget the resources of a Tk widget. Arguments are: