Re: Setting cursor for application

From: Ben L. Di Vito <bld_at_air57.larc.nasa.gov>
Date: Fri, 20 Aug 1999 11:35:37 -0400 (EDT)

> I have an application with lots of windows, and for an operation that
> takes a long time I would like to set the cursor for all windows to a
> "watch" temporarily.
>
> I can easily set the cursor for a particular widget, but can't find a
> way to set it for the entire application. I do not want to run through
> all widgets in the program and store the old cursor value, and then set
> the cursor to the watch.

One thing you might consider trying is cursor switching within <Enter>
and <Leave> bindings. Tk's binding mechanism is quite handy sometimes.
I haven't tried this, but I can believe you can do the following:

  (bind "all" "<Enter>" ...check condition, save & switch cursor...)
  (bind "all" "<Leave>" ...restore cursor...)

This should apply to all your windows/widgets. Naturally, you have to
integrate this with your other bindings. Check the Tk documentation
for exact details.

It seems like you could generalize your "watch" cursor swapping to
check for arbitrary conditions. You could have the displayed cursor
be any function of your application's current status. In fact, the
<Leave> binding wouldn't be necessary if you dynamically compute the
cursor value on each entry.

Let us know if you get something like this working. I'd be interested
in trying it myself.

Ben

---
    Ben Di Vito                     b.l.divito_at_larc.nasa.gov
    1 South Wright Street, MS 130   http://shemesh.larc.nasa.gov/~bld
    NASA Langley Research Center    voice: +1-757-864-4883
    Hampton, VA 23681   USA         fax:   +1-757-864-4234
Received on Fri Aug 20 1999 - 17:27:41 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST