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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| class Dim:
def __init__(self, master):
### Frame ###
self.frameLeft= Frame(master)
self.frameRight=Frame(master,borderwidth=2,relief=GROOVE)
self.labelFrameLeftUser=LabelFrame(self.frameLeft,text="Utilisateur")
self.labelFrameLeftRep=LabelFrame(self.frameLeft,text="Repertoire de sortie")
### Button ###
self.ButtonStart = Button(self.frameLeft, text="Start", command = self.Start)
self.ButtonStop = Button(self.frameLeft, text="Stop", command = self.Stop)
self.ButtonRep = Button(self.labelFrameLeftRep, text="Choisir rep...", command = self.repertoire)
self.ButtonNom = Button(self.labelFrameLeftUser, text="Nommer les utilisateurs", command = self.Nommage)
### Entry Box & Label ###
self.pLabel = Label(self.labelFrameLeftUser,text="Nombre de personne")
self.mlabel = Label(self.labelFrameLeftRep,text ="Nom")
self.mEntry = Entry(self.labelFrameLeftRep,textvariable=self.VarText)
### SpinBox ###
self.spinbox = Spinbox(self.labelFrameLeftUser,from_=2, to=6,state=NORMAL,command = self.Show)
### ListBox ###
self.listUser=Listbox(self.labelFrameLeftUser)
## POSITION ##
self.frameLeft.pack(side=LEFT)
self.frameRight.pack(side=RIGHT)
self.labelFrameLeftUser.grid()
self.labelFrameLeftRep.grid()
self.pLabel.grid(row=0)
self.spinbox.grid(row=0,column=1)
self.ButtonNom.grid(row=1,sticky='N')
self.listUser.grid(row=1,column=1)
self.mlabel.grid(row=2,column=0)
self.mEntry.grid(row=2,column=1,sticky='w')
self.ButtonRep.grid(row=3)
#self.ButtonShow.grid(row=3,column=1)
self.ButtonStart.grid(row=4,column=0,sticky='w')
self.ButtonStop.grid(row=4,column=1)
root = Tk()
root.geometry("800x400")
root.resizable(width=False, height=False)
D = Dim(root)
root.mainloop() |
Partager