pythonware.com | products ::: library ::: search ::: daily Python-URL! |
MixinsMixinsThe Tkinter module provides classes corresponding to the various widget types in Tk, and a number of mixin and other helper classes (a mixin is a class designed to be combined with other classes using multiple inheritance). When you use Tkinter, you should never access the mixin classes directly. Implementation mixinsThe Misc class is used as a mixin by the root window and widget classes. It provides a large number of Tk and window related services, which are thus available for all Tkinter core widgets. This is done by delegation; the widget simply forwards the request to the appropriate internal object. The Wm class is used as a mixin by the root window and Toplevel widget classes. It provides window manager services, also by delegation. Using delegation like this simplifies your application code: once you have a widget, you can access all parts of Tkinter using methods on the widget instance. Geometry mixinsThe Grid, Pack, and Place classes are used as mixins by the widget classes. They provide access to the various geometry managers, also via delegation. Table 4-2. Geometry Mixins
Widget configuration managementThe Widget class mixes the Misc class with the geometry mixins, and adds configuration management through the cget and configure methods, as well as through a partial dictionary interface. The latter can be used to set and query individual options, and is explained in further detail in the next chapter. |