GraphicsContext is another drawing utility class, similar to a
DeviceContext, which provides some higher-level or advanced functionality for drawing on screen. The
GraphicsContext is a new feature that was added back in wxPython 2.8, which can be used to access some of the platform's higher-level drawing functionality-supporting features, such as antialiasing, a floating point precision coordinate system, alpha blending, gradient brushes, and a handful of other advanced methods. In this recipe, we will make use of some of these features, most notably the gradient brush, to draw a custom control that uses gradient shading to give more depth to the control's appearance.
Here are the steps you need ...