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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
#!/usr/bin/env python
# -*- coding:Utf-8 -*-
from Tkinter import *
#paquet python-pil
from PIL import Image,ImageTk
class Application:
def __init__(self):
#self.root = Tk()
self.root =Tk()
L=300
H=225
H_image=L/2
L_image=H/2
my_file = "/home/taz/Desktop/python/3.jpg"
can = Canvas(self.root, width =L, height =H, bg ='white')
mon_image=ImageTk.PhotoImage(file=my_file)
can.create_image(H_image,L_image,image=mon_image)
can.pack()
# création de widgets 'Label' et 'Entry' :
txt1 = Label(self.root, text ='Versions')
txt2 = Label(self.root, text ='Nice')
txt3 = Label(self.root, text ='Ram')
txt4 = Label(self.root, text ='Source')
txt5 = Label(self.root, text ='Répertoire tar')
txt6 = Label(self.root, text ='Static')
txt7 = Label(self.root, text ='Point de montage en ram')
txt8 = Label(self.root, text ='TempMove')
txt9 = Label(self.root, text ='Module')
entr1 = Entry(self.root)
entr2 = Entry(self.root)
entr3 = Entry(self.root)
entr4 = Entry(self.root)
entr5 = Entry(self.root)
entr6 = Entry(self.root)
entr7 = Entry(self.root)
entr8 = Entry(self.root)
entr9 = Entry(self.root)
txt1.grid(row =1, sticky =E)
txt2.grid(row =2, sticky =E)
txt3.grid(row =3, sticky =E)
txt4.grid(row =4, sticky =E)
txt5.grid(row =5, sticky =E)
txt6.grid(row =6, sticky =E)
txt7.grid(row =7, sticky =E)
txt8.grid(row =8, sticky =E)
txt9.grid(row =9, sticky =E)
entr1.grid(row =1, column =2)
entr2.grid(row =2, column =2)
entr3.grid(row =3, column =2)
entr4.grid(row =4, column =2)
entr5.grid(row =5, column =2)
entr6.grid(row =6, column =2)
entr7.grid(row =7, column =2)
entr8.grid(row =8, column =2)
entr9.grid(row =9, column =2)
def evaluer(event):
print entree.get()
entree = Entry(self.root)
entree.bind("<Return>", evaluer)
chaine = Label(txt9)
bou1 = Button(self.root, text='Quitter', command = self.root.destroy)
#bou1.pack()
#entree.pack()
#chaine.pack()
can.grid(row =2, column =4, rowspan =13, padx =0, pady =0)
self.root.mainloop()
f = Application() |
Partager