0

When declaring event-handlers in python, this works and react on buttonclicks like it suppose to be

btn1=tk.Button(master=f, text='<<', command=self.btn_pic_prev)

In this case, the method is executed on declaration-time, but not when button-events are fired.

btn1=tk.Button(master=f, text='<<', command=self.btn_pic_prev())

or

btn1=tk.Button(master=f, text='<<', command=self.btn_pic_prev(arg))
  1. Why is that?
  2. How to pass arguments to a method/eventhandler in python?
Jomme
  • 1,256
  • 4
  • 14
  • 26

0 Answers0