title: Tkinter -tkinter.TclError
body: <p>I have the following code:</p>
  
  <pre><code>from Tkinter import *
  from urllib import urlretrieve
  
  import webbrowser
  import ttk
  def get_latest_launcher():
      webbrowser.open("johndoe.com/get_latest")
  global percent
  percent = 0
  def report(count, blockSize, totalSize):
  
     percent += int(count*blockSize*100/totalSize)
  
  
  homepage =  "http://Johndoe.com"
  root = Tk()
  root.title("Future of Wars launcher")
  Button(text="get latest version", command=get_latest_launcher).pack()
  
  global mpb
  mpb = ttk.Progressbar(root, orient="horizontal", variable = percent,length="100",
  mode="determinate")                     
  mpb.pack()
  root.mainloop()
  urlretrieve("https://~url~to~my~file.com",
  "Smyprogram.exe",reporthook=report)
  </code></pre>
  
  <p>however, if I run this script, it won't display the progressbar, and it will only display the button. It wont even download the file, and the cursor will just blink. However, if I close the gui window, I get the following code:</p>
  
  <pre><code>Traceback(most recent call last):
    File "C:\Users\user\Desktop\downloader.py", line 28 in &lt;module&gt;
     mpb = ttk.Progressbar(root, orient="horizontal", variable =
     percent,length="100",mode="determinate")
    File "C:\Users/user\Desktop\pyttk-0.3\ttk.py" line 1047, in __init__
     Widget.__init__(self, master, "ttk::progressbar", kw)
    File "C:\Users/user\Desktop\pyttk-0.3\ttk.py", line 574, in __init__
     Tkinter.Widget.__init__(self, master, widgetname, kw=kw)
    File "C:\Python26\lib\lib-tk\Tkinter.py", line 1930, in __init__
     (widgetName, self._w) + extra +  self._options(cnf))
  _tkinter.TclError: this isn't a Tk applicationNULL main window
  </code></pre>
  
  <p>What's wrong?</p>