O'Reilly logo

wxPython 2.8 Application Development Cookbook by Cody Precord

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Buttons, buttons, and more buttons

The regular Button 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.

How to do it...

To see what these different Buttons 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required