PCPP-32-101 · Question #25
What is true about the unbind() method? (Choose two.)
The correct answer is B. It is invoked from within a widget's object D. It needs the event name as an argument. Option B is true because the unbind() method is invoked from within a widget's object 1. Option D is true because the unbind() method needs the event name as an argument 1. The unbind() method in Tkinter is used to remove a binding between an event and a function. It can be…
Question
What is true about the unbind() method? (Choose two.)
Options
- AIt is invoked from within the event's object.
- BIt is invoked from within a widget's object
- CIt needs a widget's object as an argument.
- DIt needs the event name as an argument
How the community answered
(21 responses)- A5% (1)
- B90% (19)
- C5% (1)
Explanation
Option B is true because the unbind() method is invoked from within a widget's object 1. Option D is true because the unbind() method needs the event name as an argument 1. The unbind() method in Tkinter is used to remove a binding between an event and a function. It can be invoked from within a widget's object when a binding is no longer needed. The method requires the event name as an argument to remove the binding for that specific event. For example: button = tk.Button(root, text="Click me") button.bind("<Button-1>", callback_function) # bind left mouse click event to callback_function button.unbind("<Button-1>") # remove the binding for the left mouse click event
Topics
Community Discussion
No community discussion yet for this question.