File 'gui/widget.cls' (part of 'Pool_GuiBase')

Description (short)
megawidget base
Written by
Andreas Kupries
Description
base class of all megawidgets
Keywords
megawidget base, widget base class

Class 'widget'

Options
foreground
background
activeforeground
activebackground
highlightthickness
relief
border
width
height
data
Methods
public
PropagateOption (option oldValue)
SetFrame (option oldValue)
WidgetProp ()
addSubwidget (name path)
createSubwidgets ()
frameWidget (args)
setBindings ()
subwidget (name args)
widget ()
~widget ()
Membervariables
public
widgetType
subWidgets

Options

-foreground
Foreground color of widget.
-background
Background color of widget.
-activeforeground
Foreground color of widget in active state.
-activebackground
Background color of widget in active state.
-highlightthickness
Width of border (in pixels) reserved for highlighting of widget.
-relief
Relief of widget (sunken, raised, ...)
default value: flat
-border
Width of widget border, in pixels.
default value: 0
-width
The requested width of the widget, in pixels.
-height
The requested height of the widget, in pixels.
-data
Allows the association of arbitrary information with the widget. This class will not interpret the contents of this option and its subclasses should not do it either.

Methods

PropagateOption (option oldValue)

Configure procedure. Sets the new value of the option into the megawidget container and all its children.
Argument: option The name of the changed option.
Argument: oldValue The value the option had before the change.

SetFrame (option oldValue)

Configure procedure. Sets the new value of the option into the megawidget container.
Argument: option The name of the changed option.
Argument: oldValue The value the option had before the change.

WidgetProp ()

Executed after the complete initialization of the new megawidget. Initializes the recursively propagated options.

addSubwidget (name path)

Interface to derived classes. Allows them to register part of their widget structure as user-visible components of the megawidget.
Argument: name Symbolic name of the registered component.
Argument: path tk widet path of the registered component.

createSubwidgets ()

Delayed construction of the container widget holding the megawidget components. Subclasses may have changed the 'widgetType' during standard object construction. The dialog-class is an example of this.

frameWidget (args)

Basically the same as subwidget, but specialized on accessing the container widget holding the components of the megawidget. The arguments are interpreted as subcommand of the container and arguments supplied to it. This command is then executed in the calling level and its result returned as the result of this method.
Argument: args Subcommand to invoke, and its arguments.
Returns: See description.

setBindings ()

Delayed association of a binding reacting to the destruction of a megawidget.

subwidget (name args)

General accessor method to user-visible subwidgets as registered by addSubwidget. Two modes of calling are possible. Without additional arguments after the name the widget path of the specified component is retrieved and returned to the user. Otherwise the arguments will be interpreted as subcommand of the component and arguments supplied to it. This command is then executed in the calling level and its result returned as the result of this method. This mode is usually used to configure the component (like: x subwidget y configure -z w).
Argument: name Symbolic name of the component, must be the same as used in the call to addSubwidget.
Argument: args Subcommand to invoke, and its arguments. Can be empty, see description.
Returns: See description.

widget ()

Megawidget base constructor. Uses the special runtime support to delay actual construction of widgets and binding until the completion of the standard construction. 'chainToDerived' uses the same calling sequence as the constructor itself.

~widget ()

Standard destructor. Depending on the way of invocation it is possible that the widget associated to this megawidget is already destroyed. We not only have nothing to do in this case, it is actually forbidden as it would cause an error.


Membervariables

widgetType
Type of the master widget containing the components of the megawidgets. Defaults to 'frame', but is overiden by dialog to 'toplevel'.
initial value: frame
subWidgets
Maps from logical names of the user visible widget components to their actual paths. Such components are registered during widget creation (in createSubwidgets) by calling addSubwidget.

Generated by AutoDoc 2.4 at 09/14/2000, invoked by Andreas Kupries