Let me rephrase the OP's question. I believe the OP wants to remove the cancel button from the AddItem sub so that the popup window it is creating has no way to exit from the user (well, the window close button that the window manager puts in automatically may be there, but we can work on that later). This window will be visible for the duration while the perl program continues to do stuff in the background to prepare whatever, e.g., sleep 3.

And then, once this setup is done, the OP wishes that this extra status window disappears as if the user had pressed the (now-removed) cancel button.

In other languages, my first thought is to create a background thread to do the real work in, leaving the main loop on the main thread free to handle events. However, I've not done GUI programming in ages - last time I did any GUI programming on Unix was when I was learning Java, and, before that, all GUI programming had been Win16, OS/2, and Win32 - in C and Delphi Pascal. Java handles threads in a relatively transparent method, with sensible sharing, IMO. Perl's threads ... well, I'd love to hear the answer to the OP to see how I can take advantage of it in other stuff I'd like to do ;-)


In reply to Re^2: How to PopUp a 'Status' window in Perl/Tk by Tanktalus
in thread How to PopUp a 'Status' window in Perl/Tk by ozboomer

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.