Hallo Tk experts, the Tcl/Tk package allows to define very nice widgets for starting R functions, for printing results and for interactive parameter input. tkdensity.R and tkttest.R demonstrate this and both demos explain how some of the tk functions can be used. For constructing new widgets I would like to see further examples showing Tcl/Tk package in action. Therefore my question: Is there a pool of well designed applications of tk functions? / Have you created a beautiful example? Here is one of my problems: To print the position of the mouse cursor the following lines of code will work: label .l2 -textvariable tvar pack .l2 bind . <Motion> { set tvar "position %x %y" } bind . <Leave> { set tvar "mouse outside" } However, I have not been able to implement this by tk* functions of the R package. Any idea? Peter Wolf (system: hppa2.0, hpux10.20, major: 1, minor: 1.0, language: R) --------------------------------------------------------------------------- Hans Peter Wolf Fak. f. Wirtschaftswissenschaften Uni Bielefeld Bielefeld, Germany email: pwolf at wiwi.uni-bielefeld.de -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 19 Jul 2000, Peter Wolf wrote:> > Hallo Tk experts,I'm not sure you'll find many of them here :)> Is there a pool of well designed applications of tk functions? /No> Have you created a beautiful example?No (well, yes, but you've seen it)> Here is one of my problems: To print the position of the mouse cursor > the following lines of code will work: > > label .l2 -textvariable tvar > pack .l2 > bind . <Motion> { set tvar "position %x %y" } > bind . <Leave> { set tvar "mouse outside" } > > However, I have not been able to implement this by tk* functions of the R > package. Any idea?It seems to translate fairly easily (and I don't really know Tcl/Tk) tt<-tktoplevel() l2<-tklabel(tt,textvariable="tvar") tkpack(l2) tkbind(tt,"<Motion>","set tvar \"position %x %y\"") tkbind(tt,"<Leave>","set tvar \"mouse outside\"") and if you like you can also read or set tvar from R using tclvar$tvar -thomas Thomas Lumley Assistant Professor, Biostatistics University of Washington, Seattle -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._