self.page = page
self.liste = liste
self.dico_labels={}
+ self.dico_mots={}
self.nBlabel = 0
self.dico_place={}
+ self.dico_mots={}
self.selection = None
self.liste_commandes = liste_commandes
self.liste_marques = liste_marques
fg = 'black',bg = 'gray95',justify = 'left')
self.dico_labels[mot]=label
self.dico_place[mot]=self.nBlabel
+ self.dico_mots[label]=mot
self.nBlabel=self.nBlabel+1
liste_labels.append(label)
self.MCbox.window_create(END,
if commande and mot : commande(mot)
def cherche_selected_item(self):
- index=self.MCbox.index(self.selection[1])
- lign,col=map(int,string.split(index,'.'))
+ try :
+ index=self.MCbox.index(self.selection[1])
+ lign,col=map(int,string.split(index,'.'))
+ except :
+ label=self.dico_labels[self.arg_selected]
+ mot=self.dico_mots[label]
+ lign=self.dico_place[mot]+1
return lign
def remove_selected_item(self):
try :
index=self.MCbox.index(self.selection[1])
+ lign,col=map(int,string.split(index,'.'))
except :
- index=self.MCbox.index(self.dico_labels[self.arg_selected] )
- lign,col=map(int,string.split(index,'.'))
+ label=self.dico_labels[self.arg_selected]
+ mot=self.dico_mots[label]
+ lign=self.dico_place[mot]+1
del self.liste[lign-1]
self.affiche_liste()
def affiche_liste(self):
""" Affiche la liste dans la fenĂȘtre"""
liste_labels=[]
+ self.dico_mots={}
self.MCbox.config(state=NORMAL)
self.MCbox.delete(1.0,END)
for grp in self.liste_groupes:
fg = 'black',bg = 'gray95',justify = 'left')
# On stocke la relation entre le nom de la commande et le label
self.dico_labels[cmd]=label
+ self.dico_mots[label]=cmd
self.MCbox.window_create(END,
window=label,
stretch = 1)