How it works...

In line 109, we create our first ttk LabelFrame widget and assign the resulting instance to the buttons_frame variable. The parent container is win, our main window.

In lines 114 to 116, we create labels and place them in LabelFrame. buttons_frame is the parent of the labels. We use the important grid layout tool to arrange the labels within the LabelFrame. The column and row properties of this layout manager give us the power to control our GUI layout.

The parent of our labels is the buttons_frame instance variable of LabelFrame, not the win instance variable of the main window. We can see the beginning of a layout hierarchy here.

We can see how easy it is to change our layout via the column and row properties. Note how we change the column to 0, and how we layer our labels vertically by numbering the row values sequentially.

The name ttk stands for themed tk. The tk-themed widget set was introduced in Tk 8.5.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.123.155