wx.BoxSizer problem

Discussion in 'Python' started by Laszlo Zsolt Nagy, Jan 21, 2005.

  1. Hi All,

    Here is the code of a frame:

    import wx
    class PanelDatabaseDefinition(wx.Panel):
    def __init__(self,parent):
    wx.Panel.__init__(self,parent)
    self.sizer = wx.BoxSizer(wx.VERTICAL)
    self.SetSizer(self.sizer)

    self.sizer.Add(wx.Button(self,label="test1"),flag=wx.EXPAND,proportion=1)

    self.sizer.Add(wx.Button(self,label="test2"),flag=wx.EXPAND,proportion=1)

    class FrameDatabaseDefinition(wx.Frame):
    def __init__(self,parent,title):
    wx.Frame.__init__(self,parent,title=title)
    self.panel = PanelDatabaseDefinition(self)
    self.sizer = wx.BoxSizer(wx.VERTICAL)
    self.SetSizer(self.sizer)
    self.sizer.Add(self.panel,flag=wx.EXPAND,proportion=1)
    self.Layout()

    I would like to use the panel PanelDatabaseDefinition on the frame
    FrameDatabaseDefinition, but I should also be able to use the panel on
    other frames. (A la "Delphi frames".) My problem is that only one of the
    buttons is visible and that one is not expanded. (System: Windows,
    Python 2.3.4, wxPython 2.5.3)
    Best,

    Laci
     
    Laszlo Zsolt Nagy, Jan 21, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,982
    Andreas Suurkuusk
    Jul 27, 2003
  2. Gandalf
    Replies:
    2
    Views:
    560
    Gandalf
    Aug 22, 2008
  3. Gandalf

    boxsizer inside a panel

    Gandalf, Aug 30, 2008, in forum: Python
    Replies:
    0
    Views:
    226
    Gandalf
    Aug 30, 2008
  4. Jamie McQuay

    wxPython BoxSizer

    Jamie McQuay, Nov 19, 2008, in forum: Python
    Replies:
    4
    Views:
    1,345
    Mike Driscoll
    Nov 19, 2008
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    550
    Bullschmidt
    May 11, 2004
Loading...

Share This Page