O'Reilly logo

WxPython 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

Designing an owner-drawn control

If you find a need in your UI that can't be filled in just the right way by the controls provided in the wxPython library, you may find that you need to make your own. In the previous chapters of this book, we covered many of the building blocks that we can now look at for ways to leverage and combine to build our own controls. In this recipe, we will build our own container control that has a custom-drawn border and appearance.

Getting ready

Ensure that you have taken a look at Chapter 8, User Interface Primitives, before continuing with this recipe. This recipe will combine the use of DeviceContext and Sizer to create a custom control.

How to do it…

  1. First, we will start by defining a subclass of PyPanel to derive ...

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