With our specification in hand and our requirements clear, it's time to start designing our solution. We'll start with the form GUI component itself.
We're going to create a basic design for our form in the following three steps:
- Determine the appropriate
input
widget for each data field - Group together related items to create a sense of organization
- Layout our widgets in their groups on a form sheet
Like all toolkits, Tkinter offers a variety of input
widgets for different kinds of data. However, ttk
offers additional widget types and enhances some (but not all!) of Tkinter's native widgets. The following table offers advice on which widgets are most appropriate for different kinds of data entry:
Widget | Description | Used for |
| Basic text entry | Single-line strings |
| Text entry with increment/decrement arrows | Numbers |
| Box with a list of choices | Choice between several values |
| Drop-down list with choices | Choice... |