我在 wxpython 中编写了一小段代码,其中拆分器窗口用于拆分对话框,一个面板具有自定义树 ctrl,另一个具有静态框。此代码在 Fedora 和 ubuntu 中运行良好,但在 Windows 中,对话框显示为空。
主要代码:
wx.Dialog.__init__(self, None, 6, 'Filters',size = (500,600) )
self.splitter = wx.SplitterWindow(self, -1)
leftPanel = wx.Panel(self.splitter, -1)
leftBox = wx.BoxSizer(wx.VERTICAL)
self.__tree = TreeFilter(leftPanel, 1)
leftBox.Add(self.__tree, -1, wx.GROW)
self.__tree.Bind(CT.EVT_TREE_ITEM_CHECKED, self.checked)
leftPanel.SetSizer(leftBox)
rightPanel = wx.Panel(self.splitter, -1)
rightBox = wx.BoxSizer(wx.VERTICAL)
self.display = wx.StaticText(rightPanel, -1, '', style=wx.ALIGN_LEFT)
rightBox.Add(self.display, -1, wx.GROW)
btnsizer = wx.StdDialogButtonSizer()
btn = wx.Button(rightPanel, wx.ID_OK)
btn.SetDefault()
btnsizer.AddButton(btn)
btn = wx.Button(rightPanel, wx.ID_CANCEL)
btnsizer.AddButton(btn)
btnsizer.Realize()
rightBox.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
rightPanel.SetSizer(rightBox)
self.splitter.SplitVertically(leftPanel, rightPanel)
self.Centre()
其中 TreeFilter 是自定义树 ctrl。请帮我解决问题