NEW
Font size
Worksheets23rd July
Total questions: 20
Worksheet time: 10mins
What does CTk() do in CustomTkinter?
Creates a text box
Creates a button
Initializes the main application window
Exits the GUI application
Which method is used to set the window size in CustomTkinter?
setsize()
resize()
geometry()
dimensions()
What is the purpose of root.mainloop() in a GUI application?
It runs the GUI in a loop until the window is closed
It destroys the GUI
It creates a new window
It packs all widgets
Which function is used to make a CTk window non-resizable?
geometry(False)
resizable(False, False)
resize(0, 0)
fixsize()
What does root.title("My App") do?
Sets the heading of a label
Adds a title to the main window
Adds a subtitle to the app
Creates a title bar button
What is the purpose of the pack() method?
Removes a widget
Positions widgets in the window
Closes the application
Saves the window layout
Which function returns the current value of a widget’s property?
config()
update()
cget()
getproperty()
How do you change the background color of a CTkButton?
button.change_color("blue")
button.bg("blue")
button.configure(fg_color="blue")
button.set(fg_color="blue")
Which method is used to modify the text in a CTkTextbox?
update()
replace()
configure()
delete()
Which of the following can be used to contain other widgets?
CTkFrame
CTkTextbox
CTkButton
CTkWindow
Which widget allows the user to enter multiple lines of text?
CTkButton
CTkEntry
CTkTextbox
CTkLabel
What is the default layout manager used if pack() is not called?
place
grid
pack
None (widget won’t be visible)
root = customtkinter.CTk() creates:
A frame
A button
A window
A label
How do you center a widget in a pack layout?
pack(side="center")
pack(anchor="center")
pack()
pack(padx=10, pady=10)
What happens if you forget to call mainloop()?
The window will still open
Widgets will work as expected
The GUI won't appear
Nothing changes
Which of the following is NOT a valid argument in geometry()?
"300x300"
"500x400+50+100"
"width:300, height:400"
"1024x768"
What is CTkFrame mostly used for?
Text input
Holding other widgets
Button creation
Resizing the window
What will eval("2 + 3 * 4") return?
"2 + 3 * 4"
14
20
11
What does the command attribute of a CTkButton do?
Sets the button color
Calls a function when the button is clicked
Changes button size
Displays text on the button
What does CTkButton(master, state="disabled") do?
Makes the button invisible
Greys out and disables the button
Hides the text
Enables button click
