If I create a tkinter GUI program with a widget that has a callback function, is there a way to ensure that this callback is not executed until the user actually interacts with the widget?
It appears that when the widget is created (scale in the example below), the callback function is executed before the user even clicks on the scale/slider.
I would like for the message "I got called" not to appear until the user clicks the slider, rather than just by running the program.
I'm using Python 2.7.13 (I need to use 2.7 for certain reasons).
M.W.E.
from Tkinter import *
top = Tk()
def Callback_param11(val):
print('\n\nI got called\n\n')
# some commands will go here
p1 = DoubleVar()
p1_slider = Scale(top, variable=p1, from_=-10, to=10, command=Callback_param11)
p1_slider.pack()
top.mainloop()