Package schrodinger :: Package ui :: Package widget :: Module tkinterwidget :: Class schroWidget
[hide private]
[frames] | no frames]

Class schroWidget

Known Subclasses:

Class for all schrodinger Tkinter widgets. Takes care of retrieving defaults for different widget classes, setting proper behavior, etc.

The class has the capability to retrieve generic defaults, environment specific defaults (environ is a possible widget argument, "dialog," "normal," etc.), and packing or grid defaults. The widget classes below provide examples of how to use the schroWidget class.

Instance Methods [hide private]
 
__init__(self, type, baseclass, parent, **kwargs)
The initialization function simply retrieves the defaults for the given widget type, and intializes the widget with the specified initialization function, using a combination of user-specified options and those set in defaults (NOTE: Defaults will override user-specified options.
 
pack(self, **kwargs)
We capture the pack method of the widget so that we can add our specific defaults.
 
grid(self, **kwargs)
We capture the grid method of the widget so that we can add our specific defaults.
 
_retrieveDflts(self, **kwargs)
Method to retrieve "environ" option if it exists, then uses the _getDflts method to retrieve applicable defaults.
 
_getDflts(self, environment, **kwargs)
Method to retrieve different sets of defaults (generic, and those specified by the "environ" argument).
 
_update_placement(self, method, **kwargs)
Method used by grid() and pack() to retrive proper placement defaults for a widget (if they exist).
Method Details [hide private]

__init__(self, type, baseclass, parent, **kwargs)
(Constructor)

 

The initialization function simply retrieves the defaults for the given widget type, and intializes the widget with the specified initialization function, using a combination of user-specified options and those set in defaults (NOTE: Defaults will override user-specified options. If defaults must be overridden, simply configure the widget after initialization: <widget>.config(<options>))

pack(self, **kwargs)

 

We capture the pack method of the widget so that we can add our specific defaults. After the defaults are added (user-specified options overwrite defaults), the original pack function is called.

grid(self, **kwargs)

 

We capture the grid method of the widget so that we can add our specific defaults. After the defaults are added (user-specified options overwrite defaults), the original grid function is called.

_retrieveDflts(self, **kwargs)

 

Method to retrieve "environ" option if it exists, then uses the _getDflts method to retrieve applicable defaults. Finally, the default types are merged to create the full defaults set.

_getDflts(self, environment, **kwargs)

 

Method to retrieve different sets of defaults (generic, and those specified by the "environ" argument). Returned as 2-Tuple.