cavalive has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Tk; use threads; # Create main window sub gui { my $main = MainWindow->new; # Add a Label and a Button to main window $main->Label(-text => 'Hello, world!')->pack; $main->Button(-text => 'Quit', -command => [$main => 'destroy'] )->pack; # Spin the message loop MainLoop; } my $server_thread = threads->create("gui"); while (1) { sleep(1); print "cav\n"; }
janitored by ybiC: Balanced <code> tags around code block, as per Monastery convention
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Making a TK GUI in a thread
by PodMaster (Abbot) on Sep 16, 2003 at 06:26 UTC | |
by cavalive (Novice) on Sep 19, 2003 at 04:00 UTC | |
by PodMaster (Abbot) on Sep 19, 2003 at 04:29 UTC | |
|
Re: Making a TK GUI in a thread
by jdtoronto (Prior) on Sep 16, 2003 at 03:38 UTC | |
|
Re: Making a TK GUI in a thread
by batkins (Chaplain) on Sep 16, 2003 at 02:24 UTC |