pydraw wxpython example application the pydrawmenubar class the pydrawmenubar class is subclass of the wx menubar class which defines the contents of the menu bar for the pydraw application it does this by creating two wx menu objects and adding them to the menu bar each wx menu implements drop down menu from the menu bar to add individual menu items the wx menuitem class is used these menu items are appended to the menu the menus are themselves appended to the menu bar note that each menu item has an id that can be used to identify the source of command event in an event handler this allows single event handler to deal with events generated by multiple menu items class pydrawmenubar(wx menubar)def __init__(self)super(__init__(filemenu wx menu(newmenuitem wx menuitem(filemenuwx id_newtext="new"kind=wx item_normalnewmenuitem setbitmap(wx bitmap("new gif")filemenu append(newmenuitemloadmenuitem wx menuitem(filemenuwx id_opentext="open"kind=wx item_normalloadmenuitem setbitmap(wx bitmap("load gif")filemenu append(loadmenuitemfilemenu appendseparator(savemenuitem wx menuitem(filemenuwx id_savetext="save"kind=wx item_normalsavemenuitem setbitmap(wx bitmap("save gif")filemenu append(savemenuitemfilemenu appendseparator(quit wx menuitem(filemenuwx id_exit'&quit\tctrl+ 'filemenu append(quitself append(filemenu'&file'drawingmenu wx menu(linemenuitem wx menuitem(drawingmenupydraw_constants line_idtext="line"kind=wx item_normaldrawingmenu append(linemenuitemsquaremenuitem wx menuitem(drawingmenupydraw_constants square_idtext="square"kind=wx item_normaldrawingmenu append(squaremenuitemcirclemenuitem wx menuitem(drawingmenu