essai peut être d'ajouter le paramètre :
TAB_TRAVERSAL
tel que :
class simpleapp_wx(wx.Frame):
    def __init__(self,parent,id,title):
        wx.Frame.__init__(self,parent,id,title,wx.TAB_TRAVERSAL)
il me semble mais à vérifier !



----- Original Message ----- 
From: "Maan ALOUN" <[email protected]>
To: <[email protected]>
Sent: Tuesday, May 08, 2012 3:16 PM
Subject: [progliste] parcourire les controle avec tab dans interface python


>
> bonjour,
>
> j'ai récupéré cet exemple  en python, mais comment je peux parcourir les
> controls dans l'interface d'exécution avec la touche tab?
>
> #!/usr/bin/python
> # -*- coding: iso-8859-1 -*-
>
> try:
>    import wx
> except ImportError:
>    raise ImportError,"The wxPython module is required to run this program"
>
> class simpleapp_wx(wx.Frame):
>    def __init__(self,parent,id,title):
>        wx.Frame.__init__(self,parent,id,title)
>        self.parent = parent
>        self.initialize()
>
>    def initialize(self):
>        sizer = wx.GridBagSizer()
>        TabFocus
>        self.entry = wx.TextCtrl(self,-1,value=u"Enter text here.")
>        sizer.Add(self.entry,(0,0),(1,1),wx.EXPAND)
>        self.Bind(wx.EVT_TEXT_ENTER, self.OnPressEnter, self.entry)
>
>        button = wx.Button(self,-1,label="Click me !")
>        sizer.Add(button, (0,1))
>        self.Bind(wx.EVT_BUTTON, self.OnButtonClick, button)
>        buttonn = wx.Button(self,-1,label="bonjour!")
>        sizer.Add(buttonn, (0,4))
>
>
>
>        self.label = wx.StaticText(self,-1,label=u'Hello !')
>        self.label.SetBackgroundColour(wx.BLUE)
>        self.label.SetForegroundColour(wx.WHITE)
>        sizer.Add( self.label, (1,0),(1,2), wx.EXPAND )
>
>        sizer.AddGrowableCol(0)
>        self.SetSizerAndFit(sizer)
>        self.SetSizeHints(-1,self.GetSize().y,-1,self.GetSize().y );
>        self.entry.SetFocus()
>        self.entry.SetSelection(-1,-1)
>        self.Show(True)
>
>    def OnButtonClick(self,event):
>        self.label.SetLabel( self.entry.GetValue() + " (You clicked the
> button)" )
>        self.entry.SetFocus()
>        self.entry.SetSelection(-1,-1)
>
>    def OnPressEnter(self,event):
>        self.label.SetLabel( self.entry.GetValue() + " (You pressed
> ENTER)" )
>        self.entry.SetFocus()
>        self.entry.SetSelection(-1,-1)
>
> if __name__ == "__main__":
>    app = wx.App()
>    frame = simpleapp_wx(None,-1,'my application')
>    app.MainLoop()
>
>
>
> Maan
>
>
> Progliste :
> Pour se désinscrire de la liste : 
> mailto:[email protected]?subject=unsubscribe
>
> Pour voir les archives de la liste :
> http://www.mail-archive.com/[email protected]/
>
> Pour accéder aux fichiers de la liste
> http://outils.archive-host.com/partage.php?id=2Qar9Hy6ftzr
> Pour y ajouter des fichiers demandez-moi le ou sur la liste ou en privé, 
> je vous répondrez en privé. 


Progliste :
Pour se désinscrire de la liste : 
mailto:[email protected]?subject=unsubscribe

Pour voir les archives de la liste :
http://www.mail-archive.com/[email protected]/       

Pour accéder aux fichiers de la liste
http://outils.archive-host.com/partage.php?id=2Qar9Hy6ftzr
Pour y ajouter des fichiers demandez-moi le ou sur la liste ou en privé, je 
vous répondrez en privé.

Répondre à