title: How to get the width of tkinter widget?
body: <p>I'm trying to assign the width of a widget (in this case a label) to a variable.</p>
  
  <p>What I have so far:</p>
  
  <pre><code>from tkinter import *
  
  def getwidth():
      print(lbl.bbox())
  
  root = Tk()
  
  lbl = Label(root, text="test text")
  lbl.grid(row=0)
  btn = Button(root, text="GO", command=getwidth)
  btn.grid(row=1)
  
  root.mainloop()
  </code></pre>
  
  <p>I would have assumed that <code>bbox()</code> returns the offset from top left and the width and height, however, the returned value is <code>{0, 0, 0, 0}</code>.</p>
  
  <p>If someone could explain why this is and what would be the step to correctly achieve this I would be greatful.</p>