Sizers... - wxPython
        Posted  
        
            by Francisco Aleixo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Francisco Aleixo
        
        
        
        Published on 2010-04-12T03:24:55Z
        Indexed on 
            2010/04/12
            3:33 UTC
        
        
        Read the original article
        Hit count: 500
        
Ok, so I'm learning about sizers in wxPython and I was wondering if it was possible to do something like:
==============================================
|WINDOW TITLE                          _ [] X|
|============================================|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxNOTEBOOKxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|________                         ___________|
|IMAGE   |                       |LoginForm  |
|________|                       |___________|
==============================================
NOTE:Yeah, I literally got this from http://stackoverflow.com/questions/1892110/wxpython-picking-the-right-sizer-to-use-in-an-application
With NOTEBOOK expanded to left and bottom, IMAGE to align to left and bottom and loginform align to right and bottom and I managed to do almost everything but now I have a problem..
The problem is that I can't align Loginform and Image separately (im using Box Sizers), and I would like to. This is the code I'm using that is causing the problem at the moment, any help is appreciated. NOTE:The code might be (HUGELY) sloppy as I'm still learning box sizers.
sizer = wx.BoxSizer(wx.VERTICAL)
sizer1 = wx.BoxSizer(wx.HORIZONTAL)
sizer1.Add(self.nb,1, wx.EXPAND)
sizer.Add(sizer1,1, wx.LEFT | wx.RIGHT | wx.EXPAND, 10)
sizer.Add((-1, 25))
sizer2 = wx.BoxSizer(wx.VERTICAL)
sizer2.Add(self.userLabel, 0)
sizer2.Add(self.userText, 0)
sizer2.Add(self.pwdLabel, 0)
sizer2.Add(self.pwdText, 0)
sizer2.Add(self.rem, 0)
sizer3 = wx.BoxSizer(wx.HORIZONTAL)
sizer3.Add(self.login, 0)
sizer3.Add(self.sair,0, wx.LEFT, 5)
sizer2.Add(sizer3, 0)
sizer4 = wx.BoxSizer(wx.HORIZONTAL)
sizer4.Add(image, 1, wx.LEFT | wx.BOTTOM)
sizer4.Add(sizer2,0, wx.RIGHT | wx.BOTTOM , 5)
sizer.Add(sizer4,0, wx.ALIGN_RIGHT | wx.RIGHT, 10)
© Stack Overflow or respective owner