Chapter 10. Geometry Management

In this chapter, we will cover the following topics:

  • Controlling layout with the pack command
  • Controlling layout with the grid command
  • Combining pack and grid
  • Creating an address book interface

Introduction

For the purpose of this chapter the term geometry management refers to the layout and the design of the interface and not the wm command. The GUI is your primary method of interacting with the end user and, as such, is your opportunity to make a good first impression.

Although the specifics of GUI design are not directly covered in this chapter, we need to keep in mind that a poorly designed and executed interface may not only result in frustration for the end user, but also may actually result in the end user looking elsewhere for a solution.

I am sure that you have seen interfaces with bizarre combinations of colors. While they may be the developer's favorite colors in the world, they are not necessarily the best choice for an application. Add in a poor selection for the font colors and you can rapidly create a GUI that is not only shocking to the eye, but also utterly unreadable.

There are many sources available that cover GUI design. Perhaps the most readily available resource though is your own computer. Look at the programs installed on your own system. One thing that you will notice is a similarity in design, color, and layout. Menus at the top, status bar at the bottom, work area easily identifiable, and buttons logically labeled. Now note the coloration. Most programs default to the system default colors as selected by the user. What better way to ensure that the end user is comfortable with the colors selected than using the ones that they have chosen? This not only provides the end user with a level of comfort, but also requires no effort on your part, as this is the default. Additionally, Tk will automatically emulate the window decorations (Frame, Maximize, Minimize, and Close buttons) of the operating system. This ensures that the basic look and feel of your application complies with the system that it is operating on.

Unless stated otherwise, we will need to access wish from the command line to complete the following examples. Launch the wish shell appropriately for your operating system and follow the instructions provided in each section.

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

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