in reply to Tk button appearance while its callback runs

How about changing the cursor to show that it's working?

$mw->Busy( '-recurse' => 1 ); # your long process goes here $mw->Unbusy( '-recurse' => 1);

Replies are listed 'Best First'.
Re: Tk button appearance while its callback runs
by Anonymous Monk on Oct 11, 2002 at 15:22 UTC
    Wonderful!

    At least I get a mouse cursor of an hourglass via
    -cursor => 'watch'
    building on your suggestion. Interestingly, I lose the
    -relief => 'sunken'
    effect unless I include this specifically within the "Busy" call. Trying to sneak in other options such as 'text', 'background', and 'foreground' seems to have no effect, thus these options are commented out in my snippet.

    Thanks,
    Brig

    my $Customized_Command_b; $Customized_Command_b = $tl->Button( -textvariable => \$Custom_Command_label, # previously defined -underline => 0, -borderwidth => $bd_width, -command => sub { $Customized_Command_b->Busy( '-recurse' => 1, -cursor => 'watch', #-text => 'Processing...', -relief => 'sunken', #-background => 'blue', #-foreground => 'blue', ); system $custom_command, @arguments, $formdir, $dir and warn "'Custom Command' problem: ", $? >> 8, "\n" and $ccmd_rc = 1 ; if ($ccmd_rc) { $View_Custom_Log_cb->configure( -background => "red1", -activebackground => "red1", ); } $Customized_Command_b->Unbusy( '-recurse' => 1 ); $tl->raise(); }, )->grid( -column => 5, -row => 14, -columnspan => 6, -sticky => 'nsew', );