Re: Something to triger



* Chris Debenham - PTS Engineer <Chris Debenham Sun COM> [2005-07-12 07:30]:
Two ways to do this (that I can think of)

Add a timeout to populate the list.
ie.
$timer = Glib::Timeout->add($interval, \&populate_list)

Which is the canonical way, really. And by returning a false
value from `populate_list` after the procedure finishes running
the timeout will automatically be removed.

Note that if the procedure takes a long time to run, your GUI
will be unresponsive meanwhile (no reaction to clicks, no
redrawing if your window was intermittently obscured by another,
etc), so you might want to sprinkle a few

    Gtk2->main_iteration while Gtk2->events_pending;

in strategic locations anyway so as to give Gtk a chance to react
to events while youâre busy doing something else.

Regards,
-- 
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;



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