Butch has asked for the wisdom of the Perl Monks concerning the following question:

To all,

I'm developing a TK script which updates a series of buttons and switches based upon information from within a database. I've used the 'repeat' command on the TK main window to update the screen by pulling data out of the database:-

# Constantly refresh the GUI $mw->repeat( 1000 => sub { &GUI_Refresh } );
I've also got a number of child processes monitoring serial ports and doing other fun stuff (basically I'm asking quite a lot from the script).

Functionally this all works fine however I have an annoying problem with the windows cursor which keeps going 'busy' and flickering between the hour glass and the normal pointer (it's going to give my end user a headache).

Does anybody know of a command (TK or other) which prevents the cursor from going busy. At the moment I have changed the default busy cursor graphic, within windows setup, to be the same as the default arrow (proper hacker) - can this be automated from within Perl or is there a even better solution?

Thanks in advance for any help provided,
Butch.

Replies are listed 'Best First'.
Re: Cursor busy annoyance
by zentara (Cardinal) on May 12, 2006 at 13:02 UTC
    Hi, I can't say what the hidden ramifications of this will do to your system, because the Busy method prevents any input while busy, but try this:
    #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); $mw->geometry('200x200+500+500'); my $message = $mw->Label( -text => "busy cursor test")->pack( -fill => 'x' ); #comment this block out for normal busy operation { no warnings; sub Tk::Widget::Busy{} } $mw->repeat(500, sub{ $mw->Busy }); $mw->repeat(600, sub{ $mw->Unbusy }); MainLoop();

    I'm not really a human, but I play one on earth. flash japh
      Thanks again Zentara

      That seems to do the trick!

      Cheers.