Chapter 11. GUI Construction: Part 2

In this chapter, we will cover:

  • The Grid Layout Geometry Manager
  • The Pack Geometry Manager
  • Radio buttons to select one from many
  • Check buttons (Tick boxes) to select some of many
  • Keystroke event handling
  • Scrollbar
  • Frames
  • Custom DIY Controller Widgets (a slimmer slider)

Introduction

In this chapter, we provide more recipes for the Graphical User Interfaces(GUI). The recipes in the previous chapter were devised as basic ways of interacting with your code while it is running. In this chapter we extend these ideas and try to tie them together.

We start by exploring the characteristics of the two layout geometry managers. Throughout this book, up until this chapter we have used the grid manager as it seems to be the one that gives us most control over the appearance of the GUI.

One choice we are forced to make when we write Tkinter code that uses widgets is how we are going to arrange the widgets inside the master widget that contains them. There are two layout geometry managers to choose from: the pack and the grid. The pack manager is the easiest to use until you have your own ideas of how you want the furniture arranged in your house, with furniture and house being useful metaphors for widget and containing widget. The grid manager gives you absolute control of layout.

..................Content has been hidden....................

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