这是我的代码:
sizer = wx.FlexGridSizer(10, 6, 10, 10)
# here i had all the other stuff an put it in the sizer
# self refere to a wx.panel
# SPACE
for v in range(0, 40):
sizer.Add(10,10,wx.EXPAND)
btn = wx.Button(self, wx.ID_ANY, "Enregistrer")
btn.Bind(wx.EVT_BUTTON, self.save)
sizer.Add(btn, 2, wx.ALIGN_BOTTOM|wx.ALIGN_RIGHT)
self.SetSizer(sizer)
我搞不懂为什么按钮不在拐角处。在
你能帮帮我吗?在
声明的you
FlexGridSizer
(10x6)大小与放入其中的项目数(40+1按钮)不匹配。 稍微修改一下代码:我们得到这个:
但是,如果希望按钮分别位于屏幕最右下角,则可能需要添加多个大小调整器或选择其他大小调整器。例如
GridSizer
或GridBagSizer
相关问题 更多 >
编程相关推荐