nerdexam
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)
  • A
    2% (1)
  • B
    95% (55)
  • C
    3% (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.

Full PCPP-32-101 Practice