I have no doc and I'm struggling to find how its done on any website. I just want to exit out of the a perl/tk menu that I create in a separate subroutine. The EXIT Action Button works to exit the menu and script but the SUBMIT Action button will not exit the menu and then continue running the script. I would like to exit the menu at the end of the get_input subroutine and continue processing the script. Here's the excerpt from the script:
my $main = MainWindow->new(); $Action_Submit = $main->Button(-text => 'Submit', -command => [\&g +et_input ])->place(-x => 700, -y => 45); $Action_Exit = $main->Button(-text => 'Exit', -command => [$main => + 'destroy'])->place(-x => 700, -y => 115); # This menu has several radio and action buttons. Once # filled out, I want to first pull all of the data input # into the menu and place them into variables....then exit. # However, + this does not Exit the menu as i would think it # should. Instead the menu stays active until we actually # exit the script. sub get_input { $ftp_loginid = $LoginID->get; $ftp_pw = $LoginPW->get; $ftp_localdir = $LocalDIR->get; $main => destroy; ...{below continue with the script] }
Is there a valid way of exiting the menu and continuing the script ? "$main => destroy;" fails to do so. Thanks. GrandFather, Yes...menu/ dialogbox...not sure of the difference. I attempted to incorporate your code but I could not get it to work. I just want to be able to Exit the Menu/ dialog when the Submit Action button is clicked. I have no idea why I cannot do this in a separate subroutine. Is the fact that I am not using the DialogBox the reason? I present a menu to the user waiting for specific text, radio buttons etc to be interfaced with, when completed, I want to gather that info and exit out of the dialog/ menu and then continue on the the script. I tried to add you code(subroutine in) and i thought I would get another menu(dialogbox) but for whatever reason my original menu just stays up after Submit is issued. I know I am just a rookie...seems like this should be simple but I am not getting it. thanks for any help/ guidance.

In reply to How do you exit PERL TK menu without exiting the script too ? by ljsmith91

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.