title: tkinter widgets on one frame affecting another frame alignment
body: <p>this program works functionality wise so far anyway so that's not my issue. My issue is something to do with how the alignment works for widgets with multiple frames. If I make the widgets on one frame longer width wise, than the other frames, it will center all the frames based on the widest frame rather than each individual frame. The widest frame right now in this code is 'ChangePasswordPage' as it will almost always use a long string for the label; this causes all of the other frames to shift to the left. If I remove the 'sticky="nsew"' from frame.grid(column=0, row=0, sticky="nsew") it will allign everything properly but the frame doesn't fill outwards so you can see the other frames behind each other. </p>
  
  <p>I am not sure how to fix this and would love some help. I have been trying different ways such as unloading each widget and then reloading it but getting errors there too. Any help will be highly appreciated.</p>
  
  <p>Here's my condensed code:</p>
  
  <pre><code>import tkinter as tk
  from tkinter import ttk, messagebox
  
  class CCTV(tk.Tk):
  
      def __init__(self, *args, **kwargs):
          tk.Tk.__init__(self, *args, **kwargs)
  
          container = tk.Frame(self)
          container.pack()
          container.grid_rowconfigure(0, weight=1)
          container.grid_columnconfigure(0, weight=1)
  
          self.frames = {}
  
          for F in (LoginPage, ChangePasswordPage):
              frame = F(container, self)
              self.frames[F] = frame
              frame.grid(column=0, row=0, sticky="nsew")
  
          self.creatingAccount()
  
      def show_frame(self, cont):
          frame = self.frames[cont]
          frame.tkraise()
  
      def creatingAccount(self):
          self.show_frame(LoginPage)
  
  
  
  class LoginPage(tk.Frame):
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          self.controller = controller
          self.createView()
  
      def createView(self):
          self.labelPassword = ttk.Label(self, text="Password")
          self.entryPassword = ttk.Entry(self, show = "*")
          self.buttonLogin = ttk.Button(self, text="Login", command=lambda: self.controller.show_frame(ChangePasswordPage))
  
          self.labelPassword.grid(row=2, column=3, sticky="w")
          self.entryPassword.grid(row=2, column=4, sticky="e")
          self.buttonLogin.grid(row=3, columnspan=6, pady=10)
  
  
  class ChangePasswordPage(tk.Frame):
  
      def __init__(self, parent, controller):
          tk.Frame.__init__(self, parent)
          self.controller = controller
          self.createView()
  
      def createView(self):
          self.labelSecurityQuestion = ttk.Label(self, text="A very very very very very very very very very very long string")
          self.entrySecurityQuestion = ttk.Entry(self)
          self.buttonCreateAccount = ttk.Button(self, text="Change Password", command=lambda: self.controller.show_frame(LoginPage))
  
          self.labelSecurityQuestion.grid(row=3, column=0, sticky="w")
          self.entrySecurityQuestion.grid(row=3, column=1, sticky="e")
          self.buttonCreateAccount.grid(row=5, columnspan=2, pady=10)
  
  
  app = CCTV()
  app.geometry("800x600")
  app.mainloop()
  </code></pre>