title: Passing objects into tabs inside instance of class
body: <p>I have been studying very hard to learn OOP. I understand that objects can be an instance of a class. Classes have parameters and methods and are like an 'object constructor' which the object is created from. I am reorganizing the code in my first project to allow whatever possible to be part of a class. Right now I am working on the GUI but I am having trouble understanding the process in constructing the GUI with classes. Particularly having tabs inside the class and adding objects into each tab. </p>
  
  <p>Here is an example of how my code currently looks:</p>
  
  <pre><code>import tkinter
  from tkinter import ttk
  
  
  class Win:
  
      def __init__(self, master):
          nb = ttk.Notebook(master, width=390, height=470)
          nb.pack()
  
          tab = ttk.Frame(nb)
          nb.add(tab, text='title')
  
          tab2 = ttk.Frame(nb)
          nb.add(tab2, text='Graphs')
  
          tab3 = ttk.Frame(nb)
          nb.add(tab3, text='Messages')
  
          tab4 = ttk.Frame(nb)
          nb.add(tab4, text='Instructions')
  
          label = tkinter.Label(tab, text='text')
          label.grid(row=0, column=0, sticky=tkinter.N, pady=10)
  
          menu = tkinter.Menu(master, tearoff=False)
          master.config(menu=menu)
          subMenu = tkinter.Menu(menu, tearoff=False)
          menu.add_cascade(label="File", menu=subMenu)
          subMenu.add_separator()
          subMenu.add_command(label='Exit', command=master.destroy)
  
  root = tkinter.Tk()
  root.title("SC")
  root.geometry('400x500')
  root.resizable(width=False, height=False)
  
  main_win = Win(root)
  
  root.mainloop()
  </code></pre>
  
  <p>To put objects in each tab within <code>main_win</code>, what do I do? I tried putting objects below <code>main_win</code> and then passing the parameter <code>main_win</code> in the object but that does not seem to work. Should I have a class for making tabs then create an object <code>tab</code> and pass new objects into that?</p>
  
  <p>Thanks in advance for the help. Was unable to find this specific answer anywhere.</p>