Discussion: wxPython
Afficher un message
Vieux 16/10/2007, 23h09   #5
Amaury Forgeot d'Arc
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: wxPython

jean-michel bain-cornu a écrit :
> Une astuce supplémentaire (c'est mon jour de bonté) : tu peux changer
> les textes des boutons standards avec le code suivant :
> def OnWizPageChanged(self, evt):
> texts= ('&Next >','&Cancel','< &Back','&Finish')
> for o in self.wizard.GetChildren():
> if 'Button' in str(type(o)):
> text= o.GetLabel()
> if text in texts:
> o.SetLabel('nouveau label...')


Je trouve plus joli de l'écrire ainsi:

def OnWizPageChanged(self, evt):
self.wizard.FindWindow(wx.ID_FORWARD ).SetLabel('En avant!')
self.wizard.FindWindow(wx.ID_BACKWARD).SetLabel('E n arrière!')
self.wizard.FindWindow(wx.ID_CANCEL ).SetLabel('Quitter')

--
Amaury
  Réponse avec citation
 
Page generated in 0,04526 seconds with 9 queries