Re: [gtkmm] Gtk::Main::runOneRound() or Gtk::Main::run() hook



joey yandle <jwy divisionbyzero com> writes:

> Gtk::Main::iteration() will run the main loop once.  It's a static function,
> and takes an optional arg on whether or not to block until there are 
> events pending (default is true).
> 
> You can also use a loop like
> 
>   while(Gtk::Main::events_pending()) {
>     Gtk::Main::iteration();
>   }
> 

> You can use the Glib::signal_idle().  It runs whenever gtk+ isn't busy
> doing anything.  I don't think it runs every loop, but I haven't actually
> checked the glib source to confirm this.
> 
> You would invoke it as such:
> 
>   Glib::signal_idle().connect(SigC::slot(&RemoteDevice::MainLoopOneRound));
> 
> or if you need to pass a RemoteDevice object:
>   
>   Glib::signal_idle().connect(SigC::slot(rmtDev, &RemoteDevice::MainLoopOneRound));

Thank you *very* much Joey, that was what I was looking for !!

cheers,
Giannis

PS. Is the api-reference at http://www.gtkmm.org/docs/gtk complete ?

-- 
question = ( to ) ? be : ! be;
                -- Wm. Shakespeare




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