wx.BoxSizer problem

L

Laszlo Zsolt Nagy

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top