1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
from Tkinter import *
class Application(Frame):
def __init__(self, fenetre, **kwargs):
Frame.__init__(self, fenetre,**kwargs)
self.pack()
fenetre.title('My Application')
self.clic1=Button(self, text= "CONSULTER", command=self.Consultation, bg='white', borderwidth=1)
def Consultation(self):
var_texte1=StringVar()
csl=Toplevel(self)
txt1 = Label(csl, text = 'Premier champ :')
txt1.grid(row =1, column =1)
entr1 = Entry(csl, textvariable=var_texte1, bd =5)
entr1.grid(row =1, column =2)
clic1=Button(csl, text= "CLIQUEZ ICI", command=self.Consulter, bg='white')
clic1.grid(row=1, column =3, columnspan =3, padx =4, pady =4)
csl.mainloop()
def Consulter(self):
if entr1.get()=='':
showerror ('ERROR', 'Please enter a something') |
Partager