in reply to Tk: WaitBox widget not grabbing correctly

I rather think we'd need some code that reproduces the symptoms before we can comment further.

-S

One world, one people

  • Comment on Re: Tk: WaitBox widget not grabbing correctly

Replies are listed 'Best First'.
Re^2: Tk: WaitBox widget not grabbing correctly
by Anonymous Monk on Jun 28, 2005 at 10:24 UTC
    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