It is true that I don't have MainLoop, but I don't believe that was the issue. I observed more carefully, the DialogBox actually poped up, but it is not the top window, thus it is covered by the broswer window (as you said this is a filter ;-). If I minimize the broswer, then the DialogBox shows up (or click its icon to activate it, it also shows up).

This code works, the box pops up three times:

use Tk; my $mw = MainWindow->new(); for (1..3) { $mw->DialogBox(-title => "?", -buttons => ["Yes", "No"])->Show(); }

Which makes sense, as the "command prompt" window, from where I run my script, itself is the top window.

The question is how to bring the DialogBox to top front automatically.

CGI is an interesting answer. I like it. It requires more coding, but I am willing to go that way, if there is no way to bring the DialogBox to front.

Sort of don't like the idea of Win32 GUI. Would rather reduce platform dependency.


In reply to Re^2: Tk::DialogBox as the top window by pg
in thread Tk::DialogBox as the top window by pg

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.