use strict; use Tk; use Tk::WaitBox; use Tk::ProgressBar; my($root) = MainWindow->new; my($utxt) = "Initializing..."; my($percent); my($wd); $wd = $root->WaitBox( -bitmap =>'questhead', # Default would be 'hourglass' -txt2 => 'tick-tick-tick', #default would be 'Please Wait' -title => 'Takes forever to get service around here', -cancelroutine => sub { print "\nI'm cancelling....\n"; $wd->unShow; $utxt = undef; } ); ### Do something quite boring with the user frame my($u) = $wd->{SubWidget}{uframe}; $u->configure (-relief => 'groove', -borderwidth => 5); $u->pack(-expand => 1, -fill => 'both'); $u->Label(-textvariable => \$utxt)->pack(-expand => 1, -fill => 'both' +); ## It would definitely be better to do this with a canvas... this is d +umb my($bar) = $u->ProgressBar( -variable => \$percent, -blocks => 0, -width => 20, -relief => 'sunken', ) ->pack(-expand =>1, -fill =>'both'); $wd->configure(-canceltext => 'Halt, Cease, Desist'); # default is 'Ca +ncel' $wd->Show; my($diff) = 20; for (1..$diff) { sleep(1); $percent = int($_/$diff*100); $utxt = sprintf("%5.2f%% Complete",$percent); $root->update; last if !defined($utxt); } $wd->unShow; MainLoop;  

### This code will open one MainWindow and other Wait box, But WaitBox is not really on Top of MainWindow. I am trying to get a way by which this Widget can be placed on top of MainWindow and MainWindow should not get any user actions. This is usually seen in Windows Widgets, where parent window will not accept focus unless the Child window is closed.
Let me know if you have thoughts


In reply to Re^2: Tk: WaitBox widget not grabbing correctly by Anonymous Monk
in thread Tk: WaitBox widget not grabbing correctly by Anonymous Monk

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.