Hi Monks, I have a script that runs fine on it's own. It loops and creates a window, after interacting with the user, it does it again. Sometimes looping several times creating several windows. When it is called from another script, which is a menu to run scripts, the loop creates the windows all at once and doesn't stop at any point for user interaction. Does this have anything to do with the Mainloop from the original gui? I am stumped as to why it functions independently and not when called.
#Loop through all of the drill layers GUI.... my $exitbutton = $mw->Button(-text=>'Exit',-command=> sub { &Exit },-f +ont=> $fontname,-activebackground => "red")->pack(-pady=> '0.1c',-sid +e => 'bottom'); $balloon->attach($exitbutton, -msg => "Exit the program",-balloonposit +ion => 'mouse'); my $helpbutton = $mw->Button(-text=>'Help',-command=> sub { &Help },-f +ont=> $fontname,-activebackground => "#999900")->pack(-side =>'bottom +',-pady=> '0.1c'); my $create = $mw->Button(-text=>' Create 9 hole ',-command=> sub { &ad +d_ldi},-font=> $fontname,-activebackground => $doitcolor)->pack(-side +=>'left',-expand=>1,-fill=>'none',-pady=> '0.1c',-padx=>'0.3c'); $balloon->attach($create, -msg => "Add LDI coupons to the checked +off layers",-balloonposition => 'mouse'); my $combine = $mw->Button(-text=>'Combine',-command=> sub { &combine_l +di},-font=> $fontname,-activebackground => $doitcolor)->pack(-expand= +>1,-fill=>'none',-side => 'right',-pady=> '0.1c'); $balloon->attach($combine, -msg => "Split the center hole to a mechani +cal drill layer, and option to add coupons to more layers",-balloonpo +sition => 'mouse'); my $skip = $mw->Button(-text=>'Skip',-command=> sub { &skip_drill},-fo +nt=> $fontname,-activebackground => "yellow")->pack(-expand=>1,-fill= +>'none',-side => 'right',-pady=> '0.1c'); $balloon->attach($skip, -msg => "Skip the current drill layer",-ba +lloonposition => 'mouse'); my $status=$mw->Button(-text=>'Status',-command=> sub { &status_gu +i},-font=> $fontname,-activebackground => "#9966CC")->pack(-expand=>1 +,-fill=>'none',-side => 'right',-pady=> '0.1c'); $balloon->attach($status, -msg => "View summary of script actions",-ba +lloonposition => 'mouse'); $mw->withdraw; #avoid the jumping window bug $mw->Popup; $drillinfoadded = "No"; MainLoop; #Exit the script if $feedback equals Destroy! exit 0 if $feedback eq "Destroy!"; } #The exit button in $mw was clicked sub Exit { $feedback = "Destroy!"; $mw->destroy(); } #The skip button in $mw was pushed sub skip_drill() { push(@statusinfo," "); push(@statusinfo,"$currentdrill Skipped"); $feedback = "Skip"; $mw->destroy(); }
I await knowledge...... Thanks muchly.

In reply to Looping Window by mortbarsky

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.