Python_Institute
PCPP-32-101 · Question #68
The function named f() is bound as a callback to a widget named w. You have to invoke the callback on demand. How will you do it?
The correct answer is B. w.invoke(). The invoke() method of a widget calls the function (callback) bound to that widget programmatically.
Advanced OOP
Question
The function named f() is bound as a callback to a widget named w. You have to invoke the callback on demand. How will you do it?
Options
- Af()
- Bw.invoke()
- Cw.f()
- Dw.call(f)
How the community answered
(58 responses)- A2% (1)
- B95% (55)
- C3% (2)
Explanation
The invoke() method of a widget calls the function (callback) bound to that widget programmatically.
Topics
#tkinter#widget callbacks#invoke method#event handling
Community Discussion
No community discussion yet for this question.