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))
- Why is that?
- How to pass arguments to a method/eventhandler in python?