title: _tkinter.TclError: unknown option "-menu"
body: <p>I am trying to write the object-oriented code in Python. Now I am stuck with an error:</p>
  
  <blockquote>
    <p>_tkinter.TclError: unknown option "-menu"</p>
  </blockquote>
  
  <p>I think the error lies in following line:</p>
  
  <pre><code>self.config(menu=menubar)
  </code></pre>
  
  <p>Following is my code:</p>
  
  <pre><code>import tkinter as tk
  from tkinter import ttk
  from PIL import Image, ImageTk
  import time
  LARGE_FONT = ("Verdana", 12)
  class ImgComp(tk.Tk):
  
      def __init__(self, *args, **kwargs):
  
          tk.Tk.__init__(self, *args, **kwargs)        
          container = tk.Frame(self,width=320, height=209)        
          container.pack(side="top")
          container.grid_rowconfigure(0, weight=1)
          container.grid_columnconfigure(0, weight=1)
          container.grid_propagate(False)
  
          self.frames = {}
  
          for F in (PageOne):
  
              frame = F(container, self)
              #frame['bg'] = 'red'
              self.frames[F] = frame
  
              frame.grid(row=0, column=0, sticky="nsew")
  
          self.show_frame(PageOne)        
  
      def show_frame(self, cont):
  
          frame = self.frames[cont]
          frame.tkraise()
  
  class PageOne(tk.Frame):
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          menubar = tk.Menu(self)
          filemenu = tk.Menu(menubar, tearoff=0)
          filemenu.add_command(label="New")
          filemenu.add_command(label="Open")                    
          menubar.add_cascade(label="Settings", menu=filemenu)        
          self.config(menu=menubar)
          label = tk.Label(self, text="Page One", font=LARGE_FONT)
          label.pack(pady=10,padx=10)            
  
  app = ImgComp()
  app.mainloop()
  </code></pre>
  
  <p>Also I would like to inform, I have truncated the code as I was not allowed to post a bigger code by stackoverflow. Please help. </p>