Choice controls: Checkbutton, Radiobutton and Combobox
A tkinter variable that stores the user's pick from a choice control (Checkbutton, Radiobutton or Combobox). Link it with variable= and read the choice with .get().
Understanding Choice controls: Checkbutton, Radiobutton and Combobox in VCE Software Development U3O1
What it does: The Checkbutton is linked to the BooleanVar using variable=, and .get() returns True when the box is ticked and False when it is not. Both buttons use variable=size, so they belong to the same group. Selecting one replaces the stored value and deselects the other. A Combobox uses the values= argument for its list of options. It comes from tkinter.ttk, so you write ttk.Combobox. tkinter variables such as StringVar, IntVar and BooleanVar are read with the .get() method. They have no .value attribute. Checkbutton and Radiobutton use variable=. A Combobox is a text-style control, so it uses textvariable= instead. Checkbuttons let the user tick any number of boxes. Radiobuttons sharing a variable allow only one choice.
Common mistakes: StringVar is a class, so it must be called with brackets to create the variable object. It should be choice = tk.StringVar(). variable= needs the tkinter variable object, not a string with its name. Remove the quotes: cb.config(variable=agree).
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 125–141) and word search (Modules 114–141).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
StringVar()Fill in the Blanks
Spot the Error
Student with a class code? Join your class →