title: Why is my notebook in tkinter not fully visible within a frame whereas it expands correctly outside?
body: <p>Here is my problem: I'm writing a GUI in python with tkinter and of course without being an expert the more complex it becomes, the more stange problems I find. So Here I am. 
  The small script bellow is a part of my main app and still generate my problem. I've several sub-frames in a main containing frame. In the first sub-frame, two buttons can call classes to fill the other both sub-frames.</p>
  
  <p>My problem is when I want to fill using the "local view" button the bottom frame f3 with a notebook (from the pmw package), the latter seems to be cut as if f3 couldn't expand. If I populate the middle sub-frame with a press on "global view" button, it expands f3 without expanding the notebook.</p>
  
  <p>However:</p>
  
  <ul>
  <li>If I replace the notebook by another frame, everything expands correctly.</li>
  <li>If I place the notebook <em>under</em> the subframes, it is first cut as if it was in the f3 subframe but expand correctly when "global view" button is used.</li>
  </ul>
  
  <p>Do you have any idea of what happens with my notebook ? Thank !</p>
  
  <p>To test the script, use the IF statements at lines 37 and 39 to switch between inside and under the f4 subframe, and the IF statements at lines 61 and 66 to switch between the notebook and a frame (ask me more details if required).</p>
  
  <pre><code>import sys,os
  if sys.version_info[0] &lt; 3:
      import Tkinter as tk
  else:
      import tkinter as tk
  import Pmw
  
  class MainApp():
      def __init__(self, master):
  
          self.master = master
  
          self.mainf = tk.LabelFrame(self.master, text="main")
          self.mainf.grid(row=0, column=0, padx = 10, pady = 10, sticky='nsew')
  
          self.f1 = tk.LabelFrame(self.mainf, text="f1")
          self.f1.grid(row=0, column=0, padx = 10, pady = 10, sticky='nsew')
  
          self.f2 = tk.LabelFrame(self.mainf, text="f2")
          self.f2.grid(row=1, column=0, padx = 10, pady = 10, sticky='nsew')
  
          self.f3 = tk.LabelFrame(self.mainf, text="f3")
          self.f3.grid(row=2, column=0, padx = 10, pady = 10, sticky='nsew')
  
          ### Buttons
  
          self.selButton = tk.Button(self.f1, text = 'local view', width=15, command=self.set_local_view)
          self.selButton.grid(row=0, column=0, padx = 10, pady = 10)
  
          self.allButton = tk.Button(self.f1, text = "global view", width=15, command=self.set_global_view)
          self.allButton.grid(row=0, column=1, padx = 10, pady = 10)
  
          ## Close function
          self.master.wm_protocol("WM_DELETE_WINDOW", self.exitProgram)
  
      def set_local_view(self):       
          if 1: # add the notebook in the main frame   
              DetailMon(self.mainf)
          if 0: # add the notebook in a subframe   
              DetailMon(self.f3)
  
      def set_global_view(self):              
          PreviewMon(self.f2)
  
      def exitProgram(self):
          print("Exit Button pressed")         
          self.master.destroy() 
  
  class PreviewMon():
      def __init__(self, master):  
          self.master = master
  
          self.f1 = tk.LabelFrame(self.master, text="P1", width=700, height=50)
          self.f1.grid(row=0, column=0, padx = 5, pady = 5, sticky='nsew')
          self.f1.grid_propagate(False)
  
  class DetailMon():
      def __init__(self, master):
          self.master = master
  
          if 1: # Create, grid and add a page to the notebook          
              self.notebook = Pmw.NoteBook(self.master)
              self.notebook.grid(row=3, column=0, padx = 10, pady = 10, sticky='nsew') 
              self.page = self.notebook.add('Manual')
  
          if 0: # Create a labelframe instead of a notebook
              self.page = tk.LabelFrame(self.master, text="manual")
              self.page.grid(row=0, column=0, padx = 5, pady = 5, sticky='nsew')
  
          self.group1 = tk.LabelFrame(self.page, text='f1')
          self.group1.grid(row=0, column=0, padx = 10, pady = 1, sticky='nsew')
  
          # Create a scale
          tk.Scale(self.group1, from_=10, to=40, length=600, tickinterval=5, orient='horizontal').pack()
  
  def main():
      root = tk.Tk()    
      app = MainApp(root)
      root.mainloop()
  
  if __name__ == '__main__':
      main()
  </code></pre>