title: Tkinter - Dynamic Font Size Changing
body: <p>I have pretty much tried everything, and looked everywhere for how to dynamically change fonts in a <code>Text()</code> widget. I don't want all the text in the <code>Text()</code> widget to change just the text which is typed after the change of font size, like pages or word etc.</p>
  
  <p>This is what I imagined would work:</p>
  
  <pre><code>#in the __init__ function
      sizesList = [8, 10, 12, 13, 14, 16, 18, 22, 26, 32, 40]
      var = IntVar()
      var.set(13)
      self.fontsizeDropDown = OptionMenu(self.toolbarFrame, var, *sizesList, command=self.fontSizeFunc)
      self.fontsizeDropDown.grid(row=0, column=1, sticky=N)
  
  def fontSizeFunc(self, var):
      theFont = "Arial %d" % var
      self.textentry.tag_add('texthere', INSERT, INSERT)
      self.textentry.tag_config('texthere', font=theFont)
  </code></pre>
  
  <p>However all it does is change the size of the letter after the cursor, only if there is a letter there, then any further typing goes back to original font size.</p>