title: Having trouble with packing and unpacking frames in Tkinter
body: <p>I'm writing a fairly simple program in Python, but it uses Tkinter, and I'm having some trouble with <code>pack()</code> and <code>pack_forget()</code>.  I'm in Python 3.4.  Essentially, I currently have a simple program, with three buttons: Play, Instructions, and Settings.  No problems.  The Play button command just executes <code>pack_forget()</code> on the <code>Frame(main)</code> which has the three buttons.  </p>
  
  <p>Because of this I need three separate <code>play()</code> commands for each play button, because each calls <code>pack_forget()</code> on a different frame. Is there a way to execute <code>pack_forget()</code> on whatever frame is currently packed so I can have only one <code>play()</code> function called for all three play buttons?</p>
  
  <p>(Here is what the code looks like, simplified of course):</p>
  
  <pre><code>def play_1():
      title.pack_forget()
      game.pack()
  
  def play_2():
      instructions.pack_forget()
      game.pack()
  
  def play_3():
      settings.pack_forget()
      game.pack()
  
  from tkinter import *
  main = Tk()
  
  title = Frame(main).pack()
  instructions = Frame(main)
  settings = Frame(main)
  
  play_button1 = Button(title, text="Play", command=play_1)
  play_button2 = Button(instructions, text="Play", command=play_2)
  play_button3 = Button(settings, text="Play", command=play_3)
  </code></pre>
  
  <p>I'm just looking for a solution that will allow me to combine <code>play_1()</code>, <code>play_2()</code>, and <code>play_3()</code> into a single function.  </p>