class Doe (Tkinter.Frame):
def __init__ (self, root, handler):
Tkinter.Frame.__init__ (self, root)
frameDoe = Tkinter.Frame(root)
frameDoe.pack()
self.cptImage = 0
self.index = dict ()
self.ev_old = ""
self.slist = rwidgets.ScrolledList (frameDoe, self.handlerCommentaire)
self.slist.pack (side=Tkinter.LEFT, ipadx = 100, padx = 30)
self.text = Tkinter.Text(self, bg='white', height=11, width=40)
#self.text.configure(state='disabled')
self.text.pack (side=Tkinter.LEFT, padx = 30)
self.text.configure(state='normal')
def handlerCommentaire (self, ev):
if ev != "":
if self.ev_old <> "" :
if self.index.has_key(self.ev_old):
self.index[self.ev_old] = self.text.content()
#On charge le commentaire associé a l'image choisie
self.text.update(self.index[ev])
if self.ev_old != ev:
self.ev_old = ev |