我有以下尺寸相关代码:
import wx
class TableSelectPanel(wx.Panel):
def __init__(self, parent, *args, **kwargs):
wx.Panel.__init__(self, parent, *args, **kwargs)
self.title = wx.StaticText(self, label="Select Table")
self.tableList = wx.ListBox(self)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.title)
sizer.Add(self.tableList, flag=wx.EXPAND)
self.SetSizerAndFit(sizer)
class LobbyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None)
self.tableSelect = TableSelectPanel(self)
#window size
self.SetMinSize((800, 600))
self.SetMaxSize((800, 600))
self.SetSize((800, 600))
#sizers
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(self.tableSelect, flag=wx.EXPAND)
self.SetSizer(sizer)
self.Show(True)
我所期望的是,我将有一个800x600窗口,其中wx.ListBox
垂直延伸以适应整个桌子的高度。然而,虽然我有一个800x600窗口,wx.ListBox
并没有扩展到整个高度。更确切地说,面板似乎确实展开了,但列表框没有:
我做错了什么?你知道吗
将
proportion
设置为1:相关问题 更多 >
编程相关推荐