Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-12 Thread Michael Torrie
On 10/10/2012 06:17 AM, Filip Lamparski wrote: Thanks, your method works. However, it still takes the program quite a bit to load up, and my problem is that I want display the window as soon as possible. If that helps, here is how the program loads up: Script starts The window is constructed

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-10 Thread Filip Lamparski
Thanks, your method works. However, it still takes the program quite a bit to load up, and my problem is that I want display the window as soon as possible. If that helps, here is how the program loads up: Script starts The window is constructed Window events are connected to their handlers

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-08 Thread Simon Feltman
On Sun, Oct 7, 2012 at 9:10 PM, Michael Torrie torr...@gmail.com wrote: Maybe the best way is to avoid processes or threads altogether. Since downloading this thumbnail is io-bound, not cpu-bound, once you send off your request, just use io watches to trigger the main loop when something has

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-08 Thread Filip Lamparski
It looks like I could put it into the constructor for the TEDTalkWidget, right? Because that would be awesome. On 8 October 2012 08:32, Simon Feltman s.felt...@gmail.com wrote: Agreed, better yet, the code could become much simpler using an async pixbuf: def on_image_ready(stream, res,

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread jcupitt
On 6 October 2012 15:48, Filip Lamparski matka.pooha...@gmail.com wrote: However, the thumbnail loading process takes a long time, so I want to put it into another process, with the GUI displaying a spinner or a progress bar until the loading finishes. Sorry, I don't use Python much, but in C

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread Filip Lamparski
I specifically want to avoid using GLib's threading machinery in order to use multiprocessing, since later I want to add multithreading to the thumbnail loading process itself in order to utilise multiple cores more efficiently. That is because at first run, I have to download 128 images, and the

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread jcupitt
Sorry I missed the process bit. To have the load in another process, use a pipe to send worker results back to the main process, and add the pipe to your gtk main loop as an event source. You obviously can't use any gtk/glib stuff in your worker, you'd need to just make a .jpg, then do all the

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread Filip Lamparski
On 7 October 2012 12:58, jcup...@gmail.com wrote: To have the load in another process, use a pipe to send worker results back to the main process, and add the pipe to your gtk main loop as an event source. Is there any way I could do that? I looked at GLib's main loop and Gtk's main loop,

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread Simon Feltman
On Sun, Oct 7, 2012 at 12:29 PM, Filip Lamparski matka.pooha...@gmail.com wrote: On 7 October 2012 12:58, jcup...@gmail.com wrote: To have the load in another process, use a pipe to send worker results back to the main process, and add the pipe to your gtk main loop as an event source. Is

Re: Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-07 Thread Michael Torrie
On 10/07/2012 08:41 PM, Simon Feltman wrote: On Sun, Oct 7, 2012 at 12:29 PM, Filip Lamparski matka.pooha...@gmail.com wrote: On 7 October 2012 12:58, jcup...@gmail.com wrote: To have the load in another process, use a pipe to send worker results back to the main process, and add the pipe to

Best way to busy-wait in Python 3 / Gtk+ 3?

2012-10-06 Thread Filip Lamparski
Hello, I'm writing a simple application which is supposed to display the contents of the TED RSS feed in a way similar to how the official app works on Android. However, the thumbnail loading process takes a long time, so I want to put it into another process, with the GUI displaying a spinner or