[R] tcltk: use of .Tcl.callback

Cleber N.Borges klebyn at yahoo.com.br
Sun Dec 4 01:12:26 CET 2016


Dear,
How to properly use the function: .Tcl.callback( ) to trigger a single R
function with different values?
Below is my stupid solution ... The expected behavior is this but I
would like to know how to do it right.

Thanks in advanced

cleber

##############################################

library( tcltk )
top <- tktoplevel()

dummyCopyCutR <- function( optionXXX ){
     if( optionXXX=="copy" ) print("Option Copy")
     if( optionXXX=="cut"  ) print("Option Cut" )
     }

strcmd <- strsplit( .Tcl.callback( dummyCopyCutR ), " %" )[[1]][1]

tkbind( top, '<Control-c>', paste( strcmd, 'copy' ) )
tkbind( top, '<Control-x>', paste( strcmd, 'cut'  ) )

##############################################


---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus

	[[alternative HTML version deleted]]



More information about the R-help mailing list