Je voudrais placer mes composants dans un gridder (comme pour tKinter) et non au pixel près.
Si j'ai bien lu la doc, on peut utiliser le composant GridBagSizer. Par contre, je n'arrive pas du tout à le mettre en place. J'ai essayé de m'aider de la démo:

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
19
20
import wx
 
class TRenseignement(wx.Panel):
    def __init__(
            self, parent, ID, pos=wx.DefaultPosition,
            size=wx.DefaultSize, style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN|wx.FULL_REPAINT_ON_RESIZE,
            name='Renseignement'
            ):
 
        wx.Panel.__init__(self, parent, ID, pos, size, style,name)
 
        gbs = self.gbs = wx.GridBagSizer(5,5)
        LblNom = wx.StaticText(self, 0, "Nom")
        font = wx.Font(14, wx.SWISS, wx.NORMAL, wx.NORMAL)
        LblNom.SetFont(font)
        gbs.Add(LblNom,(0,0),(1,0), wx.ALIGN_CENTER | wx.ALL, 5)
        LblPrenom = wx.StaticText(self, 1, u'Pr\xe9nom')
        font = wx.Font(14, wx.SWISS, wx.NORMAL, wx.NORMAL)
        LblPrenom.SetFont(font)
        gbs.Add(LblPrenom,(0,1),(1,0), wx.ALIGN_CENTER | wx.ALL, 5)
Quand j'affiche la page, je n'ai que LblPrenom qui est affiché (en fait LblNom est affiché dessous et n'est donc pas visible).
En gros, mon GridBagSizer n'est pas du tout pris en compte. Comment faire pour qu'il le soit ?