Bonjour !
encore un probleme
je suis en train de realiser un petit jeu pour me familiariser avec les objet mais aparament ce n'est pas gagné!
mon prog n'est en fait qu'une classe. En voila un morceau :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Tout(Frame):
    def __init__(self):
        Frame.__init__(self)
        self.x = 302
        self.y = 435
        self.c = Canvas(self, height=440, width=600, bg="light yellow")
        self.photo = PhotoImage(file ='lab3.gif')
        self.img = self.c.create_image(300, 220, image = self.photo)
        self.im = Image.open('lab3.GIF')
        self.c.pack()
        self. l = self.c.create_rectangle(self.x, self.y, self.x+20, self.y+20)
        self.bind('<Left>', lambda arg='gauche': self.deplace(arg))
        self.bind('<Right>', lambda arg='droite': self.deplace(arg)) 
        self.bind('<Up>', lambda arg='haut': self.deplace(arg)) 
        self.bind('<Down>', lambda arg='bas': self.deplace(arg)) 
        b_fin = Button(self, text ='Terminer', bg ='royal blue', fg ='white', font =('Helvetica', 10, 'bold'), command =self.quit)
        b_fin.pack()
        self.pack()
mon probleme est qu'une foielancé mon programme ne repond pas aux self.bind
pourtant dans mon tuto il y a des choses cimilaires mais la sa ne fonctionne pas.
la grande question est Pourquoi??
merci
+