pydraw wxpython example application the circle class this is another subclass of figure it implements the on_paint(method by drawing circle note that the shape will be drawn within the panel size defined via the figure class (using the call to superit is therefore necessary to see the circle to fit within these bounds this means that the size attribute must be used to generate an appropriate radius also note that the drawcircle(method of the device context takes point that is the centre of the circle so this must also be calculated class circle(figure)def __init__(selfparentpossize)super(__init__(parent=parentpos=possize=wx size(sizesize)self radius (size self circle_center wx point(self point self radiusself point self radiusdef on_paint(selfdc)dc drawcircle(pt=self circle_centerradius=self radiusthe line class this is another subclass of figure in this very simple examplea default end point for the line is generated alternatively the program could look for mouse released event and pick up the mouse at this location and use this as the end point of the line class line(figure)def __init__(selfparentpossize)super(__init__(parent=parentpos=possize=wx size(sizesize)self end_point wx point(self point sizeself point sizedef on_paint(selfdc)dc drawline(pt =self pointpt =self end_point