Python Spin Boxes are copying each other and I don't see why?
<p>I am writing a code to create a time calendar, and for some reason the starting and ending time dials are mirroring each other. I have looked over everything, but I can't see any reason why the code would do such a thing. </p>

<p>Here is the code?</p>

<pre><code>from Tkinter import *
import math
Master = Tk()

def Value_Check():
    Start_Hours = eval(Starting_Hours.get())
    Start_Min = eval(Starting_Minutes.get())
    End_Hours = eval(Ending_Hours.get())
    End_Min = eval(Ending_Minutes.get())

    Start_Time_Window = ((Start_Hours*60)+ Start_Min)
    End_Time_Window = ((End_Hours*60)+ End_Min)
    Total_Window = (Start_Time_Window - End_Time_Window)
    Window_Hours = math.floor(Total_Window/60)
    Window_Minutes = (Total_Window - Window_Hours)

    print "You have a ", Window_Hours, "Hours and", Window_Minutes, "minute window to test"


Frame_Start_Window= Frame(Master)
Frame_Start_Window.pack()

#Setting the starting time of the testing window
Start_Time_Frame = Frame(Master)
Start_Time_Frame.pack( side = BOTTOM )

Starting_Title = Label(Frame_Start_Window, text = "When can you start testing?                      ")
Starting_Title.pack()

Starting_Hours = Spinbox(Frame_Start_Window, text =  "Hour", from_ = 1, to =  24, wrap =True, width = 2, command = Value_Check)
Starting_Hours.pack(side = LEFT)

Collen_Title = Label(Frame_Start_Window, text = ":")
Collen_Title.pack(side = LEFT)

Starting_Minutes = Spinbox(Frame_Start_Window, text =  "Minutes", from_ = 0, to = 59, wrap =True, width = 2, command = Value_Check)
Starting_Minutes.pack(side = LEFT)

#The end half of the testing window:
Frame_End_Window= Frame(Master)
Frame_End_Window.pack()

#Setting the starting time of the testing window:
End_Title = Label(Frame_End_Window, text = "What time do you HAVE to stop testing?")
End_Title.pack()

Ending_Hours = Spinbox(Frame_End_Window, text =  "Hour", from_ = 1, to = 24,  wrap =True, width = 2, command = Value_Check)
Ending_Hours.pack(side = LEFT)

Collen2_Title = Label(Frame_End_Window, text = ":")
Collen2_Title.pack(side = LEFT)

Ending_Minutes = Spinbox(Frame_End_Window, text =  "Minutes", from_ = 0, to = 59, wrap =True, width = 2, command = Value_Check)
Ending_Minutes.pack(side = LEFT)

#Where the answer from the Test_Calculator button is displayed:
Results_Screen = Text(Master, height=2, width=65)
Results_Screen.pack()


Data_Reset = Button (Master, text = "Reset Values", command = Value_Check)
Data_Reset.pack()

mainloop()
</code></pre>

<p>The answer is that <code>Spinbox</code> has no <code>text</code> configuration parameter:  It has <code>textvariable</code>, for which it's accepting <code>text</code> as an abbreviation.  This means you have two independent Spinbox widgets both using the <code>textvariable</code> of <code>Hour</code> and two independent Spinbox widgets both using the <code>textvariable</code> of <code>Minute</code>.  The <code>textvariable</code> setting tells the Spinbox to link the content of the Spinbox to the content of the named variable; any time the Spinbox changes, the named variable will change, and any time the named variable changes, the Spinbox will change.  Thus, you change the value in one Spinbox, it updates the variable, which in turn updates the other Spinbox.</p>

python tkinter