Léa-Linux & amis :   LinuxFR   GCU-Squad   GNU
python label sur une image ?
Envoyé par: panthere noire

Hello
comment mettre les control sur l'image ? si je remplace dans la section widgets 'Label' et 'Entry' : fen par can l'image est pas adaptée ? un paramètre a ajouter a gris j'ai aussi essayer mai rien de concluant
Note si je doit utiliser autre chose que ImageTk je suis preneur smiling smiley
code:

#!/usr/bin/env python
# -*- coding:Utf-8 -*-
from Tkinter import *
from PIL import Image,ImageTk


fen = Tk()
L=1024
H=768
H_image=L/2
L_image=H/2

my_file = "/home/taz/Desktop/python/1.png"
can = Canvas(fen, 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(fen, text ='Premier champ :')
txt2 = Label(fen, text ='Second :')
txt3 = Label(fen, text ='Troisième :')
entr1 = Entry(fen)
entr2 = Entry(fen)
entr3 = Entry(fen)


txt1.grid(row =1, sticky =E)
txt2.grid(row =2, sticky =E)
txt3.grid(row =3, sticky =E)
entr1.grid(row =1, column =2)
entr2.grid(row =2, column =2)
entr3.grid(row =3, column =2)
can.grid(row =1, column =3, rowspan =3, padx =10, pady =5)

fen.mainloop()

net install--> sid2.6.32 dist i386
fluxbox
nvidia 8800gtx 768 ddr3

Poste le Tuesday 2 September 2008 17:56:34
Répondre     Citer    

Veuillez vous authentifier auparavant pour commenter.

 

Ce forum !
python label sur une image ?
Pour poser vos questions sur les scripts shell, le Perl, le C, etc... Attention : nous ne sommes pas des spécialistes du dev, ce forum est juste pour de petites aides ponctuelles concernant le développement et les outils de développement.

Sauf mention contraire, les documentations publiées sont sous licence Creative-Commons