By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,008 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

BoxSizer problem - some help please

P: 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
Share this Question
Share on Google+
1 Reply


bartonc
Expert 5K+
P: 6,596
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.