Re: how to handle other class event loop ?
- From: Brian Manning <elspicyjack gmail com>
- To: silent <silent2600 gmail com>
- Cc: gtk-perl-list gnome org
- Subject: Re: how to handle other class event loop ?
- Date: Sat, 26 Sep 2009 19:01:50 -0700
On Sat, Sep 26, 2009 at 6:29 PM, silent <silent2600 gmail com> wrote:
Â Â when I add other Class(not gtk2::*) to programe,
and it has a event loop function like gtk_main(), let me call it "abc_main()",
how can run both gtk_main() and abc_main() ?
when the code run into gtk_main(), it will not return unless destroy
You could try calling your abc_main() from a Glib::Timeout  event,
assuming your abc_main() event loop is polite about returning control
back to Gtk2->main. If not, then you might want to look at separate
processes or threads and communicating via pipes/sockets.
Example Glib::Timeout usage (taken from one of my scripts ):
Glib::Timeout->add( $timeout, \&subroutine, $sub_args );
# this is how you pass in multiple objects/variables
Glib::Timeout->add( 500, \&check_terminal, [$b_term, $b_term_label] );
][Date Next] [Thread Prev