Adding LabelFrame and other widgets

Our form is divided into sections with a label for and a box around each section. For each section, we'll create a LabelFrame widget and start adding our LabelInput widgets to it by performing the following steps:

  1. Let's start with the record information frame by executing the following code:
        recordinfo = tk.LabelFrame(self, text="Record Information")
Remember that the text argument to LabelFrame defines the text of the label. This widget will be passed as the parent widget to all the inputs in the record information group.
  1. Now, we'll add the first line of the input widgets, as follows:
 self.inputs['Date'] = LabelInput(recordinfo, "Date", input_var=tk.StringVar()) self.inputs['Date'].grid(row=0, column=0) ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.