O'Reilly logo

Python GUI Programming with Tkinter by Alan D. Moore

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating our form

Now that our widgets are all made, it's time to make the form use them by performing the following steps:

  1. Scroll down to the DataRecordForm class constructor, and we'll start updating our widgets one row at a time. Line 1 is fairly straightforward:
        self.inputs['Date'] = LabelInput(            recordinfo, "Date",            input_class=DateEntry,            input_var=tk.StringVar())        self.inputs['Date'].grid(row=0, column=0)        self.inputs['Time'] = LabelInput(            recordinfo, "Time",            input_class=ValidatedCombobox,            input_var=tk.StringVar(),            input_args={"values": ["8:00", "12:00", "16:00", "20:00"]})        self.inputs['Time'].grid(row=0, column=1)        self.inputs['Technician'] = LabelInput(            recordinfo, "Technician",            input_class=RequiredEntry,            input_var=tk.StringVar())

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required