这是第二个盒子的代码:
self.approveItem = wx.Button(self.panel_1, -1, "Approve Item")
self.changeQty = wx.Button(self.panel_1, -1, "Change Qty")
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
sizer_2.Add(self.approveItem, 0, wx.ALIGN_RIGHT | wx.RIGHT, 0)
sizer_2.Add(self.changeQty, 0, wx.ALIGN_RIGHT| wx.RIGHT, 0)
self.sizer_item_staticbox = wx.StaticBox(self, -1, "")
sizer_item = wx.StaticBoxSizer(self.sizer_item_staticbox, wx.HORIZONTAL)
sizer_item.SetMinSize((600,-1))
sizer_item.Add(sizer_2, 0, wx.EXPAND, 0)
我怎么修?在
有很多方法可以达到您想要的效果,包括使用flexgridsizer、gridsizer和普通的水平和垂直BoxSizer,这里是一个gridsizer示例。
我做了5列宽,这样你可以在左边插入额外的按钮,如果你愿意的话。
参见:http://wxpython.org/Phoenix/docs/html/GridSizer.html
下面的代码将给出您想要的结果。在
但是请注意,对齐是通过设置比例和添加一个垫片来完成的,该垫片将按钮推到右侧。我发现这比摆弄对齐标志更容易理解/易读。在
相关问题 更多 >
编程相关推荐