This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman. It was last updated in 2013 and is unmaintained.  

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.