[R-gui] Tcl\Tk help needed for time-consuming calculations

James Wettenhall wettenhall at wehi.EDU.AU
Tue Sep 27 05:45:41 CEST 2005


Hi Fay,

> I've tried using tkconfigure(tt,cursor="watch"), but it only appears at
> the end of the loading.

Maybe try focusing the window you've applied the watch cursor to:
tkfocus(tt)
after setting the cursor, but before doing the time-consuming calculation.

I have found that the Tcl/Tk watch cursor doesn't do what I expect on
MacOSX (with X11 Tcl/Tk) - sometimes I still see an arrow, or a different
arrow, rather than wait/watch/hourglass cursor.  But you should be OK on
Windows.

> but am unsure of how to
> "refresh" the window each time.

Maybe use tkdelete to delete the components you want to update (e.g. a
tkframe or a tkrplot image), then recreate them and pack them or place
them on the window with tkpack or tkgrid or whatever.  Of course you may
want to consider tkdeleting the whole window and recreating it from
scratch.

Best wishes,
James



More information about the R-SIG-GUI mailing list