Next / Previous / Contents

5. Standard attributes

Before we look at the widgets, let's take a look at how some of their common attributes—such as sizes, colors and fonts—are specified.

  • Each widget has a set of options that affect its appearance and behavior—attributes such as fonts, colors, sizes, text labels, and such.

  • You can specify options when calling the widget's constructor using keyword arguments such as text='PANIC!' or height=20.

  • After you have created a widget, you can later change any option by using the widget's .config() method. You can retrieve the current setting of any option by using the widget's .cget() method. See Section 26, “Universal widget methods” for more on these methods.