title: How to insert a scrollbar and a form in a notebook widget with python and tkinter?
body: <p>I am really new to python and currently I am trying to design a form using tkinter. I am stuck trying to insert an scrollbar and a form in a notebook since I haven't found an answer to my question, and it is simple "How can I insert a scrollbar and a form in a notebook tkinter widget?"... As you can see is simple for you, but not for a newbie like me!</p>
  
  <p>However, this is what I have done so far, fortunately it does show the scrollbar, but it crashes when I try insert the form into the notebook!</p>
  
  <p>Note: My python version is Python 2.7.3 with EPD_free 7.3-2 (32-bit)</p>
  
  <pre><code>import Tkinter
  from Tkinter import * 
  from ttk import *   
  import tkMessageBox 
  import ttk  
  import Tkinter as tk 
  
  root = Tk()
  root.title("Model_A")
  root.resizable(0,0)
  
  # start of Notebook (multiple tabs)
  notebook = ttk.Notebook(root)
  notebook.pack(fill=BOTH, expand=True)
  notebook.pressed_index = None
  
  #Child Frames
  ContainerOne = Frame(notebook)
  ContainerOne.pack(fill=BOTH, expand=True)
  ContainerTwo = Frame(notebook)
  ContainerTwo.pack(fill=BOTH, expand=True)
  ContainerThree = Frame(notebook)
  ContainerThree.pack(fill=BOTH, expand=True)
  ContainerFour = Tkinter.Frame(notebook)
  ContainerFour.pack(fill=BOTH, expand=True)
  
  #Create the pages
  notebook.add(ContainerOne, text='Mode A')
  notebook.add(ContainerTwo, text='Mode B')
  notebook.add(ContainerThree, text='Mode C')
  notebook.add(ContainerFour, text='Mode D')
  
  canvas = Canvas(ContainerOne, width=200, height=400)
  scroll = Scrollbar(ContainerOne, command=canvas.yview)
  canvas.config(yscrollcommand=scroll.set, scrollregion=(0,0,100,1000))
  canvas.pack(side=LEFT, fill=BOTH, expand=True)
  scroll.pack(side=RIGHT, fill=Y)
  canvas = Canvas(ContainerTwo, width=200, height=400)
  scroll = Scrollbar(ContainerTwo, command=canvas.yview)
  canvas.config(yscrollcommand=scroll.set, scrollregion=(0,0,100,1000))
  canvas.pack(side=LEFT, fill=BOTH, expand=True)
  scroll.pack(side=RIGHT, fill=Y)
  
  canvas = Canvas(ContainerThree, width=200, height=400)
  scroll = Scrollbar(ContainerThree, command=canvas.yview)
  canvas.config(yscrollcommand=scroll.set, scrollregion=(0,0,100,1000))
  canvas.pack(side=LEFT, fill=BOTH, expand=True)
  scroll.pack(side=RIGHT, fill=Y)
  canvas = Canvas(ContainerFour, width=200, height=400)
  scroll = Scrollbar(ContainerFour, command=canvas.yview)
  canvas.config(yscrollcommand=scroll.set, scrollregion=(0,0,100,1000))
  canvas.pack(side=LEFT, fill=BOTH, expand=True)
  scroll.pack(side=RIGHT, fill=Y)
  frame = Frame(canvas, width=200, height=1000)
  canvas.create_window(100, 500, window=frame)
  
  frameOne = None  
  
  def defocus(event):
      event.widget.master.focus_set()    
      if __name__ == '__main__':
          ContainerOne= Tkinter.Label(notebook, text=" 1. Enter Main Details: ", font=("fixedsys", "16","bold italic"))
          frameOne.grid(row=2, columnspan=7, sticky='W', \
                   padx=5, pady=5, ipadx=5, ipady=5)
  
  #Component Selection
  componentComb= ttk.Combobox(ContainerOne, width="19")
  componentComb = Combobox(ContainerOne, state="readonly", values=("A", "B", "C"))
  componentComb.grid(column=4, row=4, columnspan="5", sticky="nswe")
  componentComb.set("Main Selection")
  
  root.mainloop()
  </code></pre>