To me, it all seems about making 2 separate event loops work together. POE and Tk are event-loop systems, one needs to be the master, the other the slave. You make POE the master.
You can make Tk run POE, or Tk run Gtk2, or POE run Gtk2, etc. .....many combinations are possible with timers calling the various iteration methods, like do_one_loop
Just a tip for budding hackers out there, who may want to use some widget from one gui toolkit, in another foreign gui system :-)
For instance, here is a Tk gui controlling a Gtk2 widget
#!/usr/bin/perl -w use strict; use Gtk2; use Tk; my $mw = MainWindow->new(-title=>'Tk Window'); Gtk2->init; my $window = Gtk2::Window->new('toplevel'); $window->set_title('Gtk2 Window'); my $glabel = Gtk2::Label->new("This is a Gtk2 Label"); $window->add($glabel); $window->show_all; my $tktimer = $mw->repeat(10, sub{ Gtk2->main_iteration while Gtk2->events_pending; }); $mw->Button(-text=>' Quit ', -command => sub{exit} )->pack(); MainLoop;
In reply to Re: RFC: POE & Tk Playing well with Children
by zentara
in thread RFC: POE & Tk Playing well with Children
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |