the classes pydraw_constants circle_idtext="circle"kind=wx item_normaldrawingmenu append(circlemenuitemtextmenuitem wx menuitem(drawingmenupydraw_constants text_idtext="text"kind=wx item_normaldrawingmenu append(textmenuitemself append(drawingmenu'&drawing'the pydrawtoolbar class the drawtoolbar class is subclass of wx toolbar the classes constructor initialises three tools that are displayed within the toolbar the realize(method is used to ensure that the tools are rendered appropriately note that appropriate ids have been used to allow an event handler to identify which tools generated particular command event by reusing the same ids for related menu items and command toolsa single handler can be used to manage events from both types of sources class pydrawtoolbar(wx toolbar)def __init__(selfparent)super(__init__(parentself addtool(toolid=wx id_newlabel="new"bitmap=wx bitmap("new gif")shorthelp='open drawing'kind=wx item_normalself addtool(toolid=wx id_openlabel="open"bitmap=wx bitmap("load gif")shorthelp='open drawing'kind=wx item_normalself addtool(toolid=wx id_savelabel="save"bitmap=wx bitmap("save gif")shorthelp='save drawing'kind=wx item_normalself realize(the pydrawcontroller class this class provides the control element of the top level view it maintains the current mode and implements handler that can handle events from menu items and from the tool bar tools an id is used to identify each individual menu or tool which allows single handler to be registered with the frame