Consider following problem: I have a gtk / tk app which displays content from a website in a List(Store). I want to do the following things in order:
- display the window & start downloading
- show a progress bar
- on completion of the downloads add the data into the list(Store)
This is the condition: the user has to be able to interact with the app while it is downloading. That means that the program is in the window's mainloop during the entire download.
What does not work:
- urllib.urlopen() waits for the entire download to complete
- Popen() does not allow the communication I want between the two threads
How to notify the program that the download has complete is the biggest question
Since I am event driven anyway because of Tk/Gtk I might as well use signals
My preferred way of solving this would be registering an additional signal "dl_done" and sending that signal to gtk when the download has finished. Is that even possible? Any suggestions are apreciated!