title: Set ttk.Label textvariable inside class
body: <p>I have searched around and can't seem to find an obvious answer to this question. I'm trying to subclass ttk.Label to add some functionality, namely so that it can dynamically update the label display when called from outside methods. This works:</p>
  
  <pre><code>root = Tk()
  label = ttk.Label(root)
  label.pack()
  var = StringVar()
  label['textvariable'] = var # or label.config(textvariable=var)
  var.set('String to show on screen')
  
  root.mainloop()
  </code></pre>
  
  <p>Yet, when I try this, it shows nothing:</p>
  
  <pre><code>class NewLabel(ttk.Label):
      def __init__(self, parent=None):
          ttk.Label.__init__(self, parent)
          self.pack()
          self.var = StringVar()
          self.config(textvariable=self.var)
          self.var.set('String to show on screen')
  
  root = Tk()
  label = NewLabel(root)
  
  root.mainloop()
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>