Forum
>>
Programmazione Python
>>
GUI
>>
Come si azzera il valore di una Spinbox dopo l'utilizzo
Pagina: 1
Esegui il login per scrivere una risposta.
Pagina: 1
|
Scritto da trescon ![]() |
2017-10-24 08:31:25 - Come si azzera il valore di una Spinbox dopo l'utilizzo
|
|
Buongiorno, vi sottopongo un quesito.
Ho creatro una piccola interfaccia con Tkinter dove ci sono delle spinbox; il mio problema è fare in modo che quando premo il pulsanre cancella il valore della selezione della spinbox "lunghezza " diventi zero , come all'avvio del programma. Allego programmino per rendere meglio l'idea. Grazie a chi vorrà darmi una mano.
try:
from Tkinter import *
from Tkinter import ttk
except:
from tkinter import *
from tkinter import ttk
global dato
global lung_cavo
dato=0
def estrai():
pass
def muovi():
pass
def cancella1():
pass
radice=Tk()
radice.geometry('500x350+500+200')
radice.title("CNC")
radice.rowconfigure(0,weight=1)
radice.columnconfigure(0,weight=1)
lung_cavo = IntVar()
num_pezzi = IntVar()
adj = IntVar()
Label(radice,text ="Taglierina",width ="20",font = 50,bg = "green").place(x=150 , y=10)
l1 = Label(radice,text = "Lunghezza Taglio : ",width="15",bg = "white").place(x=15 , y=73)
l2 = Label(radice,text = "N° Pezzi : ",width="15",bg = "white").place(x=15 , y=123)
l3 = Label(radice,text = "Correzzione mm. : ",width="15",bg = "white").place(x=15 , y=173)
#i1=Entry(radice,textvariable = lung_cavo,width="5",bg = "white").place(x=120 ,y=70)
i1 = Spinbox(radice , width = 5 ,font = 40, from_ = 0, to = 1000 , increment = 5 , textvariable=lung_cavo , bd = 2).place(x = 150 , y = 69)
#i2=Entry(radice,textvariable = num_pezzi,width="5",bg = "white").place(x=120 ,y=120)
i2 = Spinbox(radice , width = 5 , font = 40,from_ = 0, to = 100 , increment = 1 , textvariable=num_pezzi , bd = 2).place(x = 150 , y = 119)
#i3=Entry(radice,textvariable = adj,width="5",bg = "white").place(x=120 ,y=170)
i3 = Spinbox(radice , width = 5 , font = 40,from_ = -5, to = 5 , increment = 1 , textvariable=adj , bd = 2).place(x = 150 , y = 169)
cancella1 = Button(radice , text ="Cancella" ,width="15", bg="brown",command = cancella1).place(x = 300 , y = 69)
conferma1 = Button(radice , text ="Conferma Taglio" ,width="15", bg="yellow",command = estrai).place(x = 150 , y = 250)
conferma2 = Button(radice , text ="Arresta Taglio" ,width="15", bg="brown",command = estrai).place(x = 150 , y = 300)
radice.mainloop()
------
Alberto |
Pagina: 1
Esegui il login per scrivere una risposta.

