title: Tkinter menubar class
body: <p>I'm trying to make my code more efficient by have a class for creating a menu bar and its contents. No errors are being reported, but it won't make the bar. (I did have it working without a class, but can't seem to get it working again!)</p>
  
  <pre><code>from Tkinter import *
  
  class MenuBar: #'player' is the name of the Tk window
      def __init__(self, menuname, Label, Drop_Label, Command, Separator = False):
          self.menubar = Menu(player)
          self.menuname = Menu(self.menubar, tearoff = 0)
          self.menuname.add_command(label = Label, command = Command)
  
          if Separator == True:
              self.menuname.add_separator()
  
          self.menubar.add_cascade(label = Drop_Label, menu = menuname)
  
          self.Create()
  
      def Create(self):
          player.config(menu = self.menubar)
  
  #example menu item
  def addMenuBar():
      exitMenu = MenuBar("filemenu", "Exit", "File", onExit, True)
      #More menu items here, function to keep it tidier.
  
  def onExit():
      #Code here
  
  player = Tk()
  
  addMenuBar()
  
  player.mainloop()
  </code></pre>
  
  <p>This does draw the Tk window, but no menu bar options, where am I going wrong?
  Cheers.</p>