The regular B
utton
class only allows for displaying a label on the button. If this is a little too plain for the needs of your application, you're in luck. wxPython also provides a wide variety of other types of buttons that provide a different look and feel, as well as extended functionality. This recipe will introduce a number of the other button controls that are available in wxPython.
Note
Version Notice: The agw
package and GradientButton
class used in the following code are only available in wxPython 2.8.9.2 and later.
To see what these different Button
s look like and what they can do, we will make a simple Panel
with some different examples of these additional button classes:
import wx import wx.lib.platebtn as pbtn import wx.lib.agw.gradientbutton as gbtn class ButtonTestPanel(wx.Panel): def __init__(self, parent): super(ButtonTestPanel, self).__init__(parent) # Attributes # Make a ToggleButton ...