Aug-22-2019, 04:52 PM
(Aug-22-2019, 03:20 PM)Denni Wrote: Okay perhaps I am not understanding something here but I have a basic issue with this as it appears to be a circular reference and even if it is not it is very confusing code.
scale = Scale(... command = mod_calc) def mod_calc(w1) : slider_value = scale.get()It appears your mod_calc is defined using scale and your scale is defined using mod_calc begging the question -- which comes first the chicken or the egg
mod_calc
is an event handler function, it is called when the slider value changes.scale
has a reference to the scale widget, it is not a function, calling scale.get()
is just using its get
method.it is not actually necessary to call
scale.get()
because the event passes the sliders value to the event handler function.def mod_calc(w1) : slider_value = scale.get()could be changed to
def mod_calc(w1) : slider_value = w1or remove that line completely
def mod_calc(slider_value) :