gmlConfigurable Class Reference

Detailed Description

Interface class for objects that are configurable 'a la Tk', i.e. using the configure and cget methods. Provides basic value checking behaviour.

Subclasses may define hook methods to e.g. validate options or clamp them to reasonable values.

A hook for configure must be named _configure_FOO, where FOO is the relevant option name with the first dash removed (if any). It takes one argument, the value provided to configure, and must return the new value for the option.

The default behavior is to just set the option to the given value.

A hook for cget must be named _cget_FOO, as above. It takes no argument and must return the current value of the option.

The default behavior is to just return the option's current value.

Public Member Functions

option subcommand args

Manage options.

configure args

Inspect or modify the options and their current and default values. args is an option eventually followed by a value.

If called as object configure, return list of triplets, each containing an option name (-foo), its default value, and its current value.

If called as object configure -foo, return a triplet containing the option name (-foo), its default value, and its current value.

If called as object configure -foo baz, set the value of option foo to baz.

If called as object configure -opt1 val1 -opt2 val2..., repeat the above.

cget option

Return the current value of option option.

reconfigure