title: Tkinter: Using the same frame to display data based on user input
body: <p>Is there a way to use the same frame to display two different layouts of data based on user input? For example, if I have a button to make a variable either true or false, is there a way to show different text, labels, and data on the same frame based on if that variable is true or false? Something like this:</p>
  
  <pre><code>self.frame1 = Frame(root)
  self.frame1.pack()
  
  def page1(self):
      self.text1 = Label(self.frame1, text='Text 1')
      self.text1.pack()
  
  def page2(self):
      self.text2 = Label(self.frame1, text='Text 2')
      self.text2.pack()
  
  self.page1_or_page2 = True
  
  if self.page1_or_page2 == True:
      page1(self)
  else:
      page2(self)
  </code></pre>
  
  <p>Also, is overlapping data on a frame the best way to achieve something like this? Thanks!</p>