in reply to Starting another Tk GUI MainLoop
MainLoop started in script #1. Also, script #1 has a button, "Start #2".
Transform script #2 into a "standalone" widget, something like:
package Widget2; Construct Tk::Widget 'Widget2'; use Tk; use Tk::Frame; # go ahead and create elements in the widget, like it would be a # standalone app (don't forget to add the close button :D
Somewhere in #1 you have ...
sub load_tool { my $class = shift; my $wdg_plugin; #plugin's own widget eval { require $class . ".pm"; if ( "$class"->isa("Tk::Widget") ) { #If there is a UI then load as widget $wdg_plugin = $mw->$class( #we're sending references )->pack(); } }; #if any errors occurred, report them if ($@) { my $msg = "Initialization of tool $class failed:\n\n"; } }
I hope you got the idea ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Starting another Tk GUI MainLoop
by Ace128 (Hermit) on Jul 18, 2005 at 13:15 UTC | |
|
Re^2: Starting another Tk GUI MainLoop
by Ace128 (Hermit) on Jul 18, 2005 at 23:31 UTC |