title: Using a Frame class in a Tk class in Python tkinter
body: <p>In the below example, I am trying to use Frame1() in MainW(). I tried many variations of the below code. The problem is that the frame object color and rowspan are not changing at all. I know there is a problem in terms of using Frame1() in MainW(). Can someone point out the error?</p>
  
  <pre><code>from tkinter import *
  
  class Frame1(Frame):
          def __init__(self, parent):
              Frame.__init__(self, parent, bg="red")
              self.parent = parent
              self.widgets()
          def widgets(self):
              self.text = Text(self)
              self.text.insert(INSERT, "Hello World\t")
              self.text.insert(END, "This is the first frame")
              self.text.grid(row=0, column=0)
  
  
  class MainW(Tk):
      def __init__(self, parent):
          Tk.__init__(self, parent)
          self.parent = parent
          self.mainWidgets()
      def mainWidgets(self):
          self.label = Label(self, text="Main window label")
          self.label.grid(row=0, column=0)
          self.window = Frame1(self)
          self.window.grid(row=0, column=10, rowspan=2)
  
  if __name__=="__main__":
      app = MainW(None)
      app.mainloop()
  </code></pre>
  
  <p>Here is the output which is not what I want. I need the frame's background red and rowspan to be 1:
  <a href="https://i.stack.imgur.com/0hmLT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0hmLT.png" alt="enter image description here"></a></p>
  
  <p>Thank you</p>