From the course: Python GUI Development with Tkinter

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Configuring widget styles

Configuring widget styles

From the course: Python GUI Development with Tkinter

Start my 1-month free trial

Configuring widget styles

- [Narrator] In this course we've learned how to create and configure a wide variety of tk widgets and up to this point we've only configured the appearance of one widget at a time by modifying it's properties. For one or two widgets, that's fine, but as our user interfaces continue to grow in scale it can become cumbersome to individually configure the look of every widget. Fortunately the themed tk module has a mechanism to help us with what is called styles. A style describes how a widget will appear depending on it's state. Tk widgets can be one or more of the ten possible states at any given time depending on how the widget has been configured and how the user is currently interacting with it. For detailed definition of what each of these states represents refer to the tk documentation on widgets. With the tk style you can describe how a widget might glow when the user hovers their mouse over it, or how to make it look subdued and grayed out if it's been disabled. Since every…

Contents