title: python: My Tkinter code sometimes does not change font family and size
body: <p>I have this python code for make GUI through tkinter.</p>
  <p>I'm trying to activate a new form(form2) on the top when I press the button on Form 1.</p>
  <p>I developed based on the inheritance of tkinter class.</p>
  <p>My code usually works well, but I found one problem.</p>
  <p>If I run Form 2 through the button event on Form 1, the font on Form 2 is not changed.</p>
  <p>Errors do not occur at all.</p>
  <p><a href="https://i.stack.imgur.com/ITnOr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ITnOr.png" alt="enter image description here" /></a></p>
  <p>but, if I run it right from the main as below, the font will be changed successfully.</p>
  <pre><code>if __name__ == '__main__':    
      form2 = Form2()
      form2.mainloop()  # execute GUI
  </code></pre>
  <p>This is my Code:</p>
  <pre><code>from tkinter.ttk import *
  import tkinter as tk
  from tkinter import messagebox
  from tkinter import *
  import tkinter.font as tkFont
  
  class Form2(tk.Tk):
      def __init__(self):
          super().__init__()  # Inheritance from tkinter class
  
          self.title(&quot;Form2&quot;)
          self.geometry(&quot;350x600&quot;)
          self.resizable(0, 0)
  
          self.label = tk.Label(self, text='form2',
                            font=tkFont.Font(family=&quot;Roboto&quot;, size=18))
          self.label.pack()
  
  
  class Form1(tk.Tk):
      def __init__(self):
          super().__init__()  # Inheritance from tkinter class
  
          self.title(&quot;Form1&quot;)
          self.geometry(&quot;350x600&quot;)
          self.resizable(0, 0)
  
          # Get Language Data
          self.label = tk.Label(self, text='form1',
                            font=tkFont.Font(family=&quot;Roboto&quot;, size=18))
          self.label.pack()
  
          # preferences button design
          self.button: object = tk.Button(self, overrelief=&quot;solid&quot;, width=10, height=2,
                                      repeatdelay=1000, repeatinterval=100,
                                      text=&quot;Preferences&quot;,
                                      font=tkFont.Font(family=&quot;Roboto&quot;, size=9),
                                      command=lambda: self.button_clicked())
          self.button.pack()
  
      @staticmethod
      def button_clicked():
          form2 = Form2()
          form2.mainloop()
  
  
  if __name__ == '__main__':
      form1 = Form1()
      form1.mainloop()
  </code></pre>
  <p>Please give me some advice.</p>