Re: automation




On Sep 18, 2005, at 10:27 AM, Scott Lanning wrote:

On Sun, 18 Sep 2005, Torsten Schoenfeld wrote:

On Sun, 2005-09-18 at 15:49 +0200, Scott Lanning wrote:


   $n = 1000;  # 500 was insufficient, though
   Gtk2->main_iteration_do(0) while $n-- > 0;


A common construct to achieve this more correctly is this:

 Gtk2->main_iteration while Gtk2->events_pending;


I've tried that too! It pops up a window,
but the widget inside doesn't paint
(so you can see through the window).

What you have is a race condition. So, even if you decided to use a Timeout instead of an Idle (giving your program n seconds to render) it still may fail, e.g. under heavy load or slow responses or whatever. It is likely that the widget itself is installing an idle to defer some processing, and your idle to kill the main loop is running first.

Is there a signal that fires when page is finished loading? Try hooking the main_quit (or installing the single-shot to call main_quit) from a handler for that.

--
The door is locked. I tried to open it, but the lock is harder to pick than a broken nose.
  -- Sensei, on 'I, Ninja'




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]