我正在尝试将我的 sizer 与我的控件连接到 wx RibbonPanel,如下所示:
class Main_Frame(wx.Frame):
def __init__(me, parent=None, id=wx.ID_ANY, size=None ):
wx.Frame.__init__(me, parent, id, size = size )
me.ribbon = RB.RibbonBar(me, wx.ID_ANY)
me.messages_page = RB.RibbonPage(me.ribbon, wx.ID_ANY, "Messages" )
me.messages_panel = RB.RibbonPanel(me.messages_page, wx.ID_ANY)
me.box = wx.BoxSizer( wx.VERTICAL )
me.messages_panel.SetSizer( me.box )
l1 = wx.StaticText( me.messages_panel, -1, label="Label1" )
me.box.Add( l1 , 0, wx.EXPAND )
t1 = wx.TextCtrl( me.messages_panel, -1 )
me.box.Add( t1 , 0, wx.EXPAND )
l1 = wx.StaticText( me.messages_panel, -1, label="Label2" )
me.box.Add( l1 , 0, wx.EXPAND )
t1 = wx.TextCtrl( me.messages_panel, -1 )
me.box.Add( t1 , 0, wx.EXPAND )
# shouldn't be necessary
me.messages_panel.Layout()
但是我所有的控件都在 (0,0) 位置。以前有人做过吗?