how can I use a panel element as it was a frame and insert boxsizer inside it? can I do such thing?
if not so how should I transfer the attach picture into a wx program?
this is the code I’m trying to use
import wx
class MyFrame(wx.Frame):
def init(self, parent, ID, title):
wx.Frame.init(self, parent, ID, title, size=(400, 250))
panel1 = wx.Panel(self,-1, style=wx.SIMPLE_BORDER, size=(400, 60))
wx.BitmapButton(panel1, wx.ID_ANY , wx.Bitmap('../images/logo.gif'),(10, 10), (204, 40) )
panel2 = wx.Panel(self,-1, style=wx.SIMPLE_BORDER)
panel1.SetBackgroundColour("#cce8fa")
panel2.SetBackgroundColour("#dededf")
panel3=wx.Panel(panel2,-1,(10,10), style=wx.SIMPLE_BORDER, size=(370, 150))
panel3.SetBackgroundColour("#ffffff")
text1=wx.StaticText(panel3, -1, 'Hello')
text2=wx.StaticText(panel3, -1, 'text text text text')
box = wx.BoxSizer(wx.VERTICAL)
box2 = wx.BoxSizer(wx.HORIZONTAL)
box2.Add(text1, 1, wx.EXPAND)
box2.Add(text2, 2, wx.EXPAND)
box.Add(panel1, 0, wx.EXPAND)
box.Add(box2, 0, wx.EXPAND)
self.SetAutoLayout(True)
self.SetSizer(box)
self.Layout()
app = wx.PySimpleApp()
frame = MyFrame(None, -1, “Sizer Test”)
frame.Show()
app.MainLoop()
thank you!