I'm trying to use a Tk::DialogBox in a way that's probably not the simple case it was meant for:

What I don't like is that when I click the default button, if I have an if statement that runs when you do that, it will go ahead and run that statement, but the dialog disappears while the code is still running. I'd like it to at least stay open long enough for the code in the if statement to finish, so the window can display status on its execution.

I know that DialogBox is ultimately derived from Toplevel, and it's probably just removing its window as soon as any of its bottom buttons are clicked because that's what it's written to do.

I've read that Tk::Derived is supposed to support making a derivative copy of a widget so you can then customize, but I've never done that before. Could it all be done inside the same Perl script as the program, or would some sort of external module be needed? What would be needed to make a version of DialogBox that lets you have more control over when the window goes away?


In reply to DialogBox that persists awhile by DcmbrAgnt

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.