0

I am designing a GUI using wxPython with flat buttons.

How can I make a thin border around the button, like button2 in the picture:

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

The button that I have now looks like this:

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

The code:

    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))

Thanks for help.

PhJu
  • 41
  • 1
  • 5

1 Answers1

1

With GenButton this should work:

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

or:

buttons.ThemedGenButton(pane, wx.ID_ANY, 'Themed - Drawn with native renderer')
Mike Driscoll
  • 32,629
  • 8
  • 45
  • 88
Werner
  • 2,086
  • 1
  • 15
  • 14
  • Okay, this is what I want, but then the button is not flat anymore... I don't want the '3D' effect around the button. – PhJu Sep 30 '14 at 13:43
  • See above, you might want to check in the wxPython demo for more options. – Werner Sep 30 '14 at 16:05