468,285 Members | 1,540 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,285 developers. It's quick & easy.

BoxSizer problem - some help please

5
I have some problems putting widgets ina BoxSizer. I experiment a lot but it doesn't seems to do what i like, i must be missing something. What i'm trying to do is to add button1 to a boxsizer for keeping button1 position at the bottom when resizing or going fullscreen. Can someone help me with that ? I'm sure it's pretty simple but i just can't get it right. Thank you.
I have the following test code:
Expand|Select|Wrap|Line Numbers
  1. import wx
  2.  
  3. class MyFrame(wx.Frame):
  4.     def __init__(self, parent, id, title):
  5.         wx.Frame.__init__(self, parent, id, title, (-1, -1), wx.Size(450, 300))
  6.         panel = wx.Panel(self, -1)
  7.         button1=wx.Button(panel, -1, "button1", pos=(30, 230))
  8.  
  9.  
  10. class MyApp(wx.App):
  11.     def OnInit(self):
  12.          frame = MyFrame(None, -1, 'layout3.py')
  13.          frame.Show(True)
  14.          return True
  15.  
  16. app = MyApp(0)
  17. app.MainLoop()
  18.  
May 11 '07 #1
1 977
bartonc
6,596 Expert 4TB
I have some problems putting widgets ina BoxSizer. I experiment a lot but it doesn't seems to do what i like, i must be missing something. What i'm trying to do is to add button1 to a boxsizer for keeping button1 position at the bottom when resizing or going fullscreen. Can someone help me with that ? I'm sure it's pretty simple but i just can't get it right. Thank you.
I have the following test code:
Expand|Select|Wrap|Line Numbers
  1. import wx
  2.  
  3. class MyFrame(wx.Frame):
  4.     def __init__(self, parent, id, title):
  5.         wx.Frame.__init__(self, parent, id, title, (-1, -1), wx.Size(450, 300))
  6.         panel = wx.Panel(self, -1)
  7.         button1=wx.Button(panel, -1, "button1", pos=(30, 230))
  8.  
  9.  
  10. class MyApp(wx.App):
  11.     def OnInit(self):
  12.          frame = MyFrame(None, -1, 'layout3.py')
  13.          frame.Show(True)
  14.          return True
  15.  
  16. app = MyApp(0)
  17. app.MainLoop()
  18.  
Yep: sizers can be a little tricky. I'll post an example asap (currently getting my dev machine hooked up to our temporary net connection).
May 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Laszlo Zsolt Nagy | last post: by
12 posts views Thread by Christo | last post: by
5 posts views Thread by Craig Keightley | last post: by
23 posts views Thread by Jason | last post: by
2 posts views Thread by Gandalf | last post: by
reply views Thread by Gandalf | last post: by
3 posts views Thread by Jamie McQuay | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.