Thanks for the help... actualy I continue to have problems... what I really wanted to do was display a loading screen while my program did its various
operations, then finally display the main gui. My plan was showing an initial gui, loading the stuff, destroying
the gui and loading the final gui, but I continue to get
spool errors... check it out

use strict;
use Thread::Use;
use threads;
use threads::shared;
my $u; share ($u);

my $load_gui = threads->create("loading_screen");

my $counter;

#Simulate program loading
while ($counter < 3) {
sleep($counter);
$counter++;
}
$u = 1;#destroy loading screen
$load_gui->join;

#Load the final gui
my $load_gui2 = threads->create("loadGui");

#keep program fom ending
while (1) {
sleep(1);
print "cav\n";
}


##GUIS###########################

sub loading_screen {
useit Tk;
my $main = MainWindow->new;
$main->repeat(100 => sub {if ($u){$main->destroy}});

# Add a Label and a Button to main window
$main->Label(-text => 'Loading!')->pack;
Tk->MainLoop;
}

sub loadGui {
useit Tk;
my $main = MainWindow->new;

# Add a Label and a Button to main window
$main->Label(-text => 'Main Gui')->pack;

# Spin the message loop
Tk->MainLoop;
}

In reply to Re: Re: Making a TK GUI in a thread by cavalive
in thread Making a TK GUI in a thread by cavalive

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.