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 48 49 50 51 52 53 54 55 56 57 58 59 60
|
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
# -- INCLUDE --
import Tkinter as tk
# -- CLASSE --
class test_tk(tk.Tk):
# -- CONSTRUCTEUR --
def __init__(self, parent):
tk.Tk.__init__(self, parent)
self.parent = parent
self.initialize()
# -- INITIALISATION DE LA FENETRE --
def initialize(self):
self.grid() #Grille
# Les boutons de gauche
self.entryLeft = tk.Entry(self) #Widget gauche
self.entryLeft.grid(column=0, row=0, sticky='EW')
buttonG1 = tk.Button(self.entryLeft, text="Roues : Gauche")
buttonG1.grid(column=0, row=0)
buttonSP = tk.Button(self.entryLeft, text="Roues : Sur Place")
buttonSP.grid(column=1, row=0)
buttonD1 = tk.Button(self.entryLeft, text="Roues : Droite")
buttonD1.grid(column=2, row=0)
buttonC1 = tk.Button(self.entryLeft, text="Roues : Centre")
buttonC1.grid(column=1, row=1)
# Les boutons de droite
self.entryRight = tk.Entry(self) #Widget droite
self.entryRight.grid(column=1, row=0, sticky='EW')
buttonG2 = tk.Button(self.entryRight, text="Roues : Gauche")
buttonG2.grid(column=0, row=1)
buttonA1 = tk.Button(self.entryRight, text="Avancer")
buttonA1.grid(column=1, row=0)
buttonC2 = tk.Button(self.entryRight, text="Roues : Centre")
buttonC2.grid(column=1, row=1)
buttonR1 = tk.Button(self.entryRight, text="Reculer")
buttonR1.grid(column=1, row=2)
buttonD2 = tk.Button(self.entryRight, text="Roues : Droite")
buttonD2.grid(column=2, row=1)
# -- ICI J'AI PAS TROP COMPRIS COMMENT CA FONCTIONNE
if __name__ == "__main__":
app = test_tk(None)
app.title('test tk')
app.mainloop() #Boucler |
Partager