Frank Samuelson
2006-Feb-10 15:14 UTC
[R] tk mouse cursor icon widget tkwinfo tkfocus questions
1. I want to change the mouse cursor over my window into a wait/watch icon while R computes. Can this be done directly? Some ancient tcltk mailing lists said change the cursor over every widget in the window: foreach widget [winfo children $window] { $widget config -cursor watch } To do this I'll need a list of R/tcl widget objects: lapply(widglist, function(z) tkconfigure(z, cursor="watch")) From where can I get this widglist? I tried: > tkwinfo("children",topwindow) <Tcl> .1.1 .1.2 .1.3 I'm guessing this is a string directly returned from tcl. Is there a way to turn this into a list of widgets after some parsing? Right now I'm using a hardcoded list for widglist, but if I or others change the layout, the coding gets messy. 2. How do I specify the force option with tkfocus? Or, more generally, any option in a tk function that doesn't take a value? I can see the force option is available from the errors at my failed attempts to specify it. MS keeps popping up my Tk window behind another window. Thanks for any help. -Frank