[R-gui] Tk/Windows focus problems

James Wettenhall wettenhall at wehi.edu.au
Wed Apr 21 13:02:17 CEST 2004


Peter and others,

[Note: The hex string below is a GraphApp Window ID.]

JW>> tt2 <- tktoplevel(use="0x000900F4")
...
JW>> tt2a <- tktoplevel(tt2)

PD>I still don't think that's what you want to do...

PD>I'd be much more interested in what happens if you do something like
PD>tkbutton(tt2). Or maybe you don't want to try that with the console
PD>window, so how about hijacking a graphics window instead? The
PD>perspective could be to modify toplevel so that it generates blank
PD>(MDI-controlled) windows from GraphApp, which we just keep using from
PD>then on.

OK, after some delays caused by a corrupt Perl installation, 
I've had another go at this.  But I'm afraid I can't get anything 
to happen by trying to create a widget e.g. tkbutton whose 
parent is a GraphApp window.  I get no error from 
button <- tkbutton(tt2,text="Press me")
But it seems that no amount of packing or gridding will make a 
Tk widget appear in a GraphApp window.  Maybe it appears for a 
microsecond, then GraphApp or Windows OS orders a redraw of the 
window according to GraphApp's specifications...

It may actually be quite difficult.  See for example, 
http://wiki.tcl.tk/2870
"Tk within frame of other application (written in, for example, 
Visual C++). So far, only works--barely--with IE. "

So if it really is too difficult, my opinion is that for some 
R/Tk applications "Always On Top" (as an option) is better 
than nothing...  

Regards,
James



More information about the R-SIG-GUI mailing list