pydraw wxpython example application def on_paint(selfevent)"""set up the device context (dcfor painting""dc wx paintdc(selffor figure in self model contentsfigure on_paint(dcthe drawingcontroller class the drawingcontroller class provides the control class for the top level mvc architecture used with the drawingmodel (modeland drawingpanel (viewclasses in particular it handles the mouse events in the drawingpanel via the on_mouse_click(method it also defines an add method that is used to add figure to the drawingmodel (the actual figure depends on the current mode of the pydrawcontrollera final methodthe clear(methodremoves all figures from the drawing model and refreshes the display class drawingcontrollerdef __init__(selfviewmodelget_mode)self view view self model model self get_mode get_mode def on_mouse_click(selfmouse_event)point mouse_event getposition(self add(self get_mode()pointdef add(selfmodepointsize= )if mode =pydrawconstants square_modefig square(self viewpointwx size(sizesize)elif mode =pydrawconstants circle_modefig circle(self viewpointsizeelif mode =pydrawconstants text_modefig text(self viewpointsizeelif mode =pydrawconstants line_modefig line(self viewpointsizeself model add_figure(figdef clear(self)self model clear_figures(self view refresh(