我想将两个面板横向放置在另一个面板上,但第二个面板没有显示出来:
这里的ChartPanel没有显示出来。上面有什么问题?
import wx
szflags = wx.EXPAND | wx.ALL
min_height = 50
height_ratio = 4
pborder = 10
lborder = 5
class ChartPanel(wx.Panel):
def __init__(self, *args, **kwargs):
wx.Panel.__init__(self, *args, **kwargs)
self.SetBackgroundColour(wx.Colour(226,226,226))
self.st = wx.StaticText(self, label='CHART PANEL')
#self.chart = bar_line.CanvasPanel(self, "320")
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.st, 1 , szflags , lborder)
#sizer.Add(self.chart, 1 , szflags)
self.SetSizer(sizer)
class NotebookPage(wx.Panel):
def __init__(self, *args, **kwargs):
fleet = kwargs.pop('fleet_name', None)
wx.Panel.__init__(self, *args, **kwargs)
self.mainPanel = NotebookPage_MainPanel(self, name='Notebook_Page_MainPanel', fleet_name=fleet)
self.chartPanel = ChartPanel(self, name='Notebook_Page_ChartPanel')
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.mainPanel, 1, wx.EXPAND|wx.ALL,border=10)
sizer.Add(self.chartPanel, 1, wx.EXPAND|wx.ALL,border=10)
self.SetSizer(sizer)
这里的ChartPanel没有显示出来。上面有什么问题?