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 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.
EDIT: So everyone can see what I mean: "Oh and what I was referring to, was basically that if I changed the align, it would affect both LoginForm and Image.. For example if I set the align to RIGHT, both image and loginform would have been aligned to the right because of: sizer.Add(sizer4,0, wx.ALIGN_RIGHT | wx.RIGHT, 10). Hope you guys can understand this time"
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. Heres a test code:
import wx
class Sizerframe(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'sizertestframe',size=(790, 524))
p = wx.Panel(self)
nb = wx.Notebook(p, size = (750, 332))
button = wx.Button(p, -1, "loginform1rest", size=(94,23))
button1 = wx.Button(p, -1, "Login", size=(94,23))
button2 = wx.Button(p, -1, "Cancel", size=(94,23))
imagebutton = wx.Button(p, -1, "imagebutton", size=(94,23))
sizer = wx.BoxSizer(wx.VERTICAL)
sizer1 = wx.BoxSizer(wx.HORIZONTAL)
sizer1.Add(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(button, 0)
sizer3 = wx.BoxSizer(wx.HORIZONTAL)
sizer3.Add(button1, 0)
sizer3.Add(button2,0, wx.LEFT, 5)
sizer2.Add(sizer3, 0)
sizer4 = wx.BoxSizer(wx.HORIZONTAL)
sizer4.Add(imagebutton, 1, wx.LEFT | wx.BOTTOM)
sizer4.Add(sizer2,0, wx.RIGHT | wx.BOTTOM , 5)
sizer.Add(sizer4,0, wx.ALIGN_RIGHT | wx.RIGHT, 10)
p.SetSizer(sizer)
def main():
app = wx.App()
frame = Sizerframe()
frame.Show()
app.MainLoop()
if __name__ == '__main__':
main()