Chapter 9. Configuring and Controlling Tk Widgets

In this chapter, we will cover:

  • Creating a frame widget
  • Creating a label widget
  • Creating an entry widget
  • Creating a button widget
  • Creating a listbox widget
  • Creating an image
  • Creating a simple form

Introduction

In the following sections, we will explore some of the most commonly used Tk widgets. By utilizing these widgets, you can easily create a data entry style form that includes not only input and informative screen text, but also provides user interaction with the help of button controls. In addition, the image command allows for the display of graphics to provide an interface to the graphical data, as well as creating a polished look and feel, by displaying images on the interface.

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

The syntax for all widgets is as follows:

	widget path keyword value

Create an element of the type specified by the command referenced in widget (frame, button, and so on) with the path specified with one or more listed keyword and value pairs. Specific keywords for each widget will be listed in the individual sections.

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

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