[helpbutton true def __init__(selfparent=none)frame __init__(selfparentself pack(expand=yesfill=bothself start(self makemenubar(self maketoolbar(self makewidgets(change per instance in subclasses set these in start(if need self make frame stretchable for subclassset menu/toolbar done herebuild menu bar done herebuild toolbar for subclassadd middle part def makemenubar(self)""make menu bar at the top (tk menus belowexpand=nofill= so same width on resize ""menubar frame(selfrelief=raisedbd= menubar pack(side=topfill=xfor (namekeyitemsin self menubarmbutton menubutton(menubartext=nameunderline=keymbutton pack(side=leftpulldown menu(mbuttonself addmenuitems(pulldownitemsmbutton config(menu=pulldownif self helpbuttonbutton(menubartext 'help'cursor 'gumby'relief flatcommand self helppack(side=rightdef addmenuitems(selfmenuitems)for item in itemsscan nested items list if item ='separator'stringadd separator menu add_separator({}elif type(item=listlistdisabled item list for num in itemmenu entryconfig(numstate=disabledelif type(item[ ]!listmenu add_command(label item[ ]commandunderline item[ ]add command command item[ ]cmd=callable elsepullover menu(menuself addmenuitems(pulloveritem[ ]sublistmenu add_cascade(label item[ ]make submenu underline item[ ]add cascade menu pulloverdef maketoolbar(self)""make button bar at bottomif any expand=nofill= so same width on resize this could support images toosee gui coding techniques