wxPython平面GenButton边框

时间:2014-09-30 09:11:51

标签: python button user-interface wxpython

我正在使用wxPython和平面按钮设计GUI。

如何在按钮周围创建一个细边框,如图中的button2:

http://i.stack.imgur.com/sYo0D.png

我现在拥有的按钮如下:

http://i.stack.imgur.com/hz3r8.png

代码:

    import wx.lib.buttons as buttons
    [...]
    self.a = buttons.GenButton(self, 00, "0", (140, 380), size=(100, 100),style=wx.BORDER_NONE)
    self.a.SetBackgroundColour((215, 215, 215))

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

使用GenButton,这应该有效:

buttons.GenButton(pane, wx.ID_ANY, "1", wx.DefaultPosition, size=(100, 100),
                  style=wx.BORDER_SIMPLE)

或:

buttons.ThemedGenButton(pane, wx.ID_ANY, 'Themed - Drawn with native renderer')