title: Error "cannot use geometry manager pack inside . which already has slaves managed by grid"
body: <p>So I am trying to allow the user to upload an image file for a flag, and then pack it into the frame. However I get the following error message <code>cannot use geometry manager pack inside . which already has slaves managed by grid</code> I do not understand why this is happening because I have tons of other widgets using <code>.pack</code> in the same frame. I have tried using <code>.pack</code> on the frames but I get this other problem where my program just crashes.
  Here is the code.</p>
  <pre><code># Imports
  from tkinter import * # Tkinter is a GUI toolkit used for Python. This toolkit allows me to create the window and many of the UI options
  import Pmw # Pmw stands for 'Python mega widgets'. I imported this primarily for tooltips so the user knows what everything means
  from PIL import ImageTk,Image
  from tkinter import filedialog
  
  # Windows
  root = Tk() # Root is the main window where I will be putting everything
  root.title('Nation Creator') # The title is the text at the top of every window
  root.state('zoomed') # This makes the window go full screen
  #Fonts
  titlefont = (&quot;Aldrich&quot;, 48)
  subtitlefont = (&quot;Aldrich&quot;, 22)
  font = (&quot;Times New Roman&quot;, 14)
  
  #lists
  hosl = [&quot;Elected Monarch&quot;, &quot;Hereditary Monarch&quot;, &quot;Elected President&quot;, &quot;Oligarchy&quot;] #These are the four types of heads of state.
  # Functions
  
  #This is so that the user can scroll thru the next frame.
  def nextframe(frame):
      frame.tkraise()
  
  # Making the frames
  def frameMaker():
      frameName = Frame(root)
      frameName.grid(row=0,column=0,sticky='nsew')
      return frameName
  
  # This is what makes my Titles
  def titleMaker(titleText, descriptionText, frame):
      title = Label(frame, text = titleText)
      title.configure(font=(titlefont))
      title.pack()
      description = Label(frame, text = descriptionText)
      description.configure(font=(subtitlefont))
      description.pack()
      return title, description
  
  # Here I am making my spaces. It gives a better asthetic look.
  def spaceMaker(spaceName, frame):
      spaceName = Label(frame, text=&quot;&quot;)
      spaceName.pack()
      return spaceName
  
  #This opens a file browser so you can select your flag
  def flagOpener():
          global flagIMG
          global flagLabel
          flagPath = filedialog.askopenfilename(initialdir=&quot;/&quot;, title=&quot;Select an Image File&quot;, filetypes=((&quot;Png Files&quot;, &quot;*.png&quot;), (&quot;Jpeg Files&quot;, &quot;*.jpg; *.jpeg&quot;), (&quot;All Files&quot;, &quot;*.*&quot;)))
          flagIMG = ImageTk.PhotoImage(Image.open(flagPath))
          flagLabel = Label(image=flagIMG)
          flagLabel.pack()
          return flagIMG, flagLabel
  #######################################################
  #######################FRAMES##########################
  #######################################################
  
  # These two commands allow the different frames to work
  root.rowconfigure(0, weight=1)
  root.columnconfigure(0, weight=1)
  # There will be 4 different frames.
  titleframe = frameMaker()
  politicalframe = frameMaker()
  econframe = frameMaker()
  miscframe = frameMaker()
  
  for frame in (titleframe, politicalframe, econframe, miscframe):
      frame.grid(row=0,column=0,sticky='nsew')
  
  nextframe(titleframe)
  # Section Headings
  # These will be the headings for the sections.
  # There will be 4 sections; Title Section, Political, Economic, and Micellanious 
  
  titleMaker(&quot;Nation Creator&quot;,&quot;Version 1.0&quot;,titleframe)
  startbutton = Button(titleframe, text = &quot;Begin&quot;, command=lambda:nextframe(politicalframe))
  startbutton.pack()
  
  #Political Section
  
  titleMaker(&quot;Political Section&quot;,&quot;This is where your nation's name, flag, territory, \nand political and personal freedoms are entered.&quot;,politicalframe)
  
  spaceMaker(&quot;pOne&quot;, politicalframe)
  
  nationNamePrompt = Label(politicalframe, text = &quot;Enter your nation's name:&quot;)
  nationNamePrompt.configure(font = (font))
  nationNamePrompt.pack()
  nationNameInput = Entry(politicalframe)
  nationNameInput.configure(font=(font))
  nationNameInput.pack()
  
  spaceMaker(&quot;pTwo&quot;, politicalframe)
  
  flagSelect = Button(politicalframe, text = &quot;Select Flag&quot;, command=flagOpener)
  flagSelect.pack()
  
  
  spaceMaker(&quot;pThree&quot;, politicalframe)
  
  territoryPrompt = Label(politicalframe, text = &quot;List Your Territory&quot;)
  territoryPrompt.configure(font=(font))
  territoryPrompt.pack()
  territoryButton = Entry(politicalframe)
  territoryButton.configure(font=(font))
  territoryButton.pack()
  
  spaceMaker(&quot;pFour&quot;, politicalframe)
  
  headOfStateVar = StringVar(politicalframe)
  headOfStateVar.set(&quot;Select Head of State&quot;)
  headOfStateType = OptionMenu(politicalframe, headOfStateVar, *hosl)
  headOfStateType.pack()
  
  spaceMaker(&quot;pFive&quot;, politicalframe)
  
  headOfStateNamePrompt = Label(politicalframe, text = &quot;What is the name of your head of state?&quot;)
  headOfStateNamePrompt.configure(font=(font))
  headOfStateNamePrompt.pack()
  headOfStateName = Entry(politicalframe)
  headOfStateName.configure(font=(font))
  headOfStateName.pack()
  
  spaceMaker(&quot;pSix&quot;, politicalframe)
  
  polcontbutton = Button(politicalframe, text = &quot;Next&quot;, command=lambda:nextframe(econframe))
  polcontbutton.pack()
  #Economic Section 
  titleMaker(&quot;Economic Section&quot;,&quot;This is where your economic freedoms and control are entered.&quot;,econframe)
  
  econbackbutton = Button(econframe, text = &quot;Back&quot;, command=lambda:nextframe(politicalframe))
  econbackbutton.pack()
  
  # Making sure the window will stay up
  root.mainloop()
  </code></pre>