Methods and Variables

New mega-widgets built using [incr Tk] should be derived from either itk::Widget or itk::Toplevel. Both classes are subclasses of itk::Archetype.

Public Methods

The following methods are built into all mega-widgets. For a mega-widget having the Tk name pathName, the following methods are supported:

pathname cget -option

Return the current value of option option.

pathname component

Return a list of the well-known components.

pathname component name command [arg...]

Invoke the given command command as a method on the component called name, optionally with additional arguments.

pathname configure

Return a list describing all of the available options.

pathname configure -option

Return the current value of option option.

pathname configure -option value...

Set the value of option option to value. Multiple option-value pairs can be supplied.

The cget and configure commands work just like the corresponding Tk widget commands.

Protected Methods

These methods are used in the implementation of a mega-widget:

itk_component add
[-protected] [-private] [--]
symbolicName  {
    widget pathName  [arg...]
} [ {
    ignore -option...
    keep   -option...
    rename -option  -newName resourceClass resourceClass
    usual [tag]
}  ]

Commands in this format create a widget and register it as a mega-widget component. The optional block containing ignore, keep, rename, and usual commands controls how the configuration options for this component are merged into the master option list for the mega-widget.

Ignore removes one or more configuration options from the composite list (the default behavior). Keep integrates one or more configuration options into the composite list, keeping them the same. Rename integrates the configuration option into the composite list with a different name. Usual finds the usual option handling commands for the specified tag name and executes them.

itk_option add optName...

Add an option that was previously ignored back into the master option list.

itk_option remove name...

Remove an option that was previously merged into the master option list.

itk_option define -option resourceName resourceClass init [configBody]

Define a new configuration option for a mega-widget class.

itk_initialize [-option value ...]

Called when a mega-widget is constructed to initialize the master option list.

Protected Variables

The following variables can be accessed within a mega-widget class:

itk_option(symbolicName)

An array element containing the Tk window pathname for the component named symbolicName.

itk_interior

Contains the name of the top-level widget or frame within a mega-widget that acts as a container for new components.

itk_option(-option)

An array element containing the current value of the configuration option named option.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset