Be able to instantiate Tk widgets, place them with pack/grid/place, bind events using correct sequence strings, and call Canvas drawing methods with proper coordinates and options. The single most important thing: know exact Tkinter method names, parameter keywords, and event sequence syntax, since questions hinge on precise API details.
Start practicing
Graphical User Interface Programming — choose a session length
Free · No account required
Domain overview
This domain covers building desktop GUIs with Python's Tkinter: widget creation and configuration, geometry managers (pack, grid, place), event binding, and the Canvas drawing API. Questions present concrete coding scenarios—drawing shapes, wiring callbacks, laying out widgets—and ask you to pick the correct method call, parameter, or event string.
Exam objectives
Canvas methods such as create_rectangle, create_oval, and create_line with coordinate and fill options
Event binding via widget.bind, including sequence strings like <Button-1> and <ButtonRelease-1>
Grid geometry manager parameters: row, column, rowspan, columnspan, sticky, and padx/pady
Window and widget configuration: Tk title, geometry, mainloop, and widget option keywords
Confusing Canvas coordinate order or using width/height instead of x1,y1,x2,y2 for create_rectangle.
Writing event strings incorrectly, e.g. <Button1> or <LeftClick> instead of <Button-1>.
Mixing geometry managers in one container, or using grid without specifying row and column.
Click any question to see the full explanation and answer options, or start a focused practice session above.
You have a Checkbutton and you need to track its state. What is the recommended way to associate a variable with the Checkbutton?
2You want to bind a function 'on_click' to a left mouse button click on a Button widget. Which event sequence string is correct?
3You need to add a label that displays static text in your GUI. Which widget is most appropriate for this purpose?
4In a Tkinter grid layout, you want a button to span across two columns. Which parameter should you use?
5You have a Tkinter Entry widget and want to retrieve the text currently entered by the user. Which method do you call on the Entry instance?
6You are creating a simple Tkinter application and notice that your window does not appear on the screen after calling the Tk() constructor. Which method must be called to start the event loop?
7Which module must be imported to utilize Tkinter in a Python script?
8What is the correct way to specify the title of a Tkinter window?
9Which widget is most suitable for displaying multi-line, editable text?
10When using the grid layout manager, which option allows a column to grow when the window is resized?
11You have a list of options and want the user to select one using a dropdown menu. Which widget should you use?
12You wish to group several widgets together within a frame. Which widget acts as a container for this purpose?
13How do you set a specific font for a widget?
14Which attribute of a Button widget controls the text displayed on it?
15You need a color chooser dialog in your application. Which module contains this functionality?
16What is the primary function of the 'bg' parameter in a widget configuration?
17Which widget is most appropriate for displaying a list of selectable items?
18When using the place() geometry manager, what is the purpose of 'relx' and 'rely'?
19How do you access the value of a StringVar associated with an Entry widget?
20Which TWO of the following are valid geometry managers in Tkinter?
21Which THREE of the following are valid ways to configure a widget's appearance after it has been created?
22Which TWO of the following events are commonly bound in Tkinter for mouse interaction?
23Which THREE of the following are valid parameters for the pack() layout manager?
24Which TWO of the following are valid ways to add padding to a widget in the grid layout?
25Which THREE of the following widgets are part of the 'ttk' (Themed Tkinter) module?
26Which TWO of the following are valid ways to terminate a Tkinter script gracefully?
27You have a Button widget and want to trigger a function named 'process_data' when the user clicks it. Which is the standard way to associate the function with the button?
28Which TWO of the following statements correctly describe the behavior of the Tkinter 'pack' geometry manager?
29Which THREE of the following are valid ways to pass arguments to a function called by a Tkinter button command?
30You are developing a Tkinter application that includes a Canvas widget for drawing a dynamic bar chart. The chart data updates every second, and you must redraw the bars. To avoid visual flicker and improve performance, you decide to reuse existing canvas items instead of deleting and recreating them. Which Canvas method should you use to change the height of an existing rectangle item identified by its item ID?
31You are developing a Tkinter application that includes a Button widget. When the user clicks the button, you need to execute a function named handle_click that accepts no arguments. Which approach correctly associates this function with the button's click event?
32You are building a Tkinter GUI that includes a Canvas widget. You want to draw a rectangle and then later change its fill color without redrawing the entire canvas. Which method should you use to update the rectangle's fill color?
33You are creating a Tkinter application with a menu bar. You want to add a keyboard shortcut (accelerator) to a menu item so that pressing Ctrl+S triggers the save action. Which option of the add_command method should you use to display the shortcut text, and what additional step is required to make the shortcut functional?
34You are building a Tkinter application with a Button widget that should run a long-running calculation when clicked, but the GUI freezes until the calculation finishes. Which approach best keeps the interface responsive while performing the calculation?
35You are designing a Tkinter application with a Listbox widget that displays multiple items. You want to allow the user to select multiple non-contiguous items (e.g., by holding Ctrl and clicking). Which configuration option of the Listbox should you set, and to what value?
36You are creating a dialog window in a Tkinter application that must block interaction with the main window until the user closes it, and must return a value to the caller. Which approach correctly implements this behavior?
37You maintain a Tkinter inventory dashboard whose main window contains a large frame with a Treeview listing warehouse items. Operators complain that when they maximize the window, the Treeview stays at its original size and leaves a large empty gray area. The frame is already managed with grid() and the Treeview is placed inside that frame with pack(). Which single change most directly makes the Treeview grow with the frame when the window is resized?
38You are developing a Tkinter application that uses multiple threads to perform background tasks. One thread updates a Label widget's text using its config method. Occasionally, the application crashes with a Tcl error about calling from a different thread. What is the correct approach to safely update the GUI from a background thread?
39You are writing a Tkinter dialog that must react to a user pressing the Escape key at any time, even when focus is inside an Entry widget. You have a function named on_cancel. Which binding correctly achieves this?
40You are placing several widgets in a window using the grid() geometry manager and want a widget to span multiple columns in the same row. Which grid() option accomplishes this?
41A Tkinter application has a modal dialog implemented as a Toplevel that collects a numeric discount. The dialog's OK button command calls a validator that may raise ValueError, and you want the dialog to stay open with an inline error label rather than crashing the mainloop. The dialog is opened from the main window with dialog.grab_set() followed by main_window.wait_window(dialog). Which approach correctly keeps the error visible and prevents the exception from propagating out of the Tkinter callback?
42You are creating a Tkinter GUI with a Canvas widget to draw a simple chart. You need to draw a filled blue rectangle from (50, 50) to (150, 100). Which Canvas method call achieves this?
43You are building a canvas-based drawing tool and need to detect when the user clicks on a specific rectangle item to select it, while other clicks should be ignored. Which canvas feature should you use?
44You are maintaining a Tkinter inventory application where users type quantities into an Entry widget. A colleague reports that the application accepts "12.5" for an item that must be a whole number, and invalid keystrokes are only caught after the user clicks Save. You must reject non-numeric input as it is typed, while still allowing a normal editing experience. Which mechanism should you register on the Entry widget?
45A desktop tool built with Tkinter needs a list of departments shown as mutually exclusive radio buttons. When the user selects a department, the underlying model object's department attribute must update immediately, and the code must read the selection later without iterating over every radio button. Which Tkinter mechanism best satisfies these requirements?
46A Tkinter application has a main window containing a Text widget used as a log console. The application performs a long-running data import and must remain responsive, so the import runs in a background thread. The worker thread needs to append status lines to the Text widget. Which approach is correct?
47A colleague built a Tkinter form where every Entry widget uses `pack()` in the same frame. They now need the labels to sit in a single column with the entries aligned in the next column and the whole form centered. They ask you to recommend the smallest structural change that makes this alignment reliable. What should you suggest?
48You are reviewing a Tkinter application that uses ttk widgets and a Canvas to draw a seating chart. The chart must redraw when the window is resized, and a toolbar above it must stay a fixed height. Which two techniques correctly contribute to a layout where the Canvas expands and the toolbar does not? (Choose two.)
49You are building a Tkinter desktop application with a menu bar. Users report two problems: keyboard shortcuts such as Ctrl+S do not trigger the Save command when focus is inside a Text widget, and mnemonic underlines on the File menu are missing. You must correct the menu configuration. Which two changes should you make? (Choose two.)
50You are prototyping a Tkinter application and want a single-line input field where users can type a search term. The field should also show a placeholder-like behavior by pre-filling the text 'Search...' when the window opens. Which widget and option combination achieves this most directly?
51A Tkinter data-entry form uses an Entry widget for a numeric amount. Users report that pressing Enter in the Entry does nothing, and the value is only saved when they click a separate Save button. You want Enter to trigger the same save routine as the button, without duplicating logic. Which binding achieves this?
52A Tkinter application uses a Canvas to draw a seating chart. Each seat is a rectangle created with create_rectangle, and seats are grouped by section. When a section is selected, every seat in it must change fill color, and some seats must later be moved to a new position. Which strategy best supports efficient grouped updates while keeping individual seats addressable?
53You are designing a Tkinter application that uses a ttk.Treeview to display a table of records. You need to configure the widget so that users can select multiple non-contiguous rows and so that the first column shows a tree-style expander control. Which two actions must you perform? (Choose two.)
54You are implementing a custom Tkinter widget that must validate user input in an Entry field and prevent non-numeric characters from being entered. Which mechanism should you use to intercept and optionally reject each keystroke before it modifies the Entry contents?
55You are developing a Tkinter application with a top-level window that contains a Frame widget. Inside the Frame, you place three Button widgets using grid(). Later, you need to add a fourth Button that should span the full width of the Frame, below the existing three. Which grid() configuration should you apply to the new Button?
56You are building a Tkinter application that uses a ttk.Treeview to display a list of employees. Each employee has an ID, name, and department. You want to display the data in columns with headings, and you need the ID column to be hidden. Which approach correctly configures the Treeview to achieve this?
57You are creating a Tkinter application with a Canvas widget. You draw a circle using create_oval and assign it the tag 'ball'. Later, you want to move the circle 10 pixels to the right and 5 pixels down. Which Canvas method should you use?
58You are building a Tkinter application with a menu bar. You want to add a 'File' menu with an 'Exit' item that terminates the application when selected. Which command should you associate with the 'Exit' menu item to properly close the application?
Be able to instantiate Tk widgets, place them with pack/grid/place, bind events using correct sequence strings, and call Canvas drawing methods with proper coordinates and options. The single most important thing: know exact Tkinter method names, parameter keywords, and event sequence syntax, since questions hinge on precise API details.
The Courseiva PCPP1 question bank contains 58 questions in the Graphical User Interface Programming domain. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Graphical User Interface Programming domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included