[R-gui] key-binding

John Fox jfox at mcmaster.ca
Tue Dec 9 20:38:09 MET 2003


Dear Thomas,

At 07:35 PM 12/9/2003 +0100, 
=?utf-8?Q?=22Untern=C3=A4hrer_Thomas=2C_uth=22?= wrote:
>Hi,
>
>I studied the examples written by James Wettenhall and find the example 
>"Pull-Down Menus and Popup Menus".
>In this example James uses the following:
>
> > copyText <- function() 
> .Tcl(paste("event","generate",.Tcl.args(.Tk.ID(txt),"<<Copy>>")))
>
>This calls a tcl-function an gives it the arguments .Tcl.args.
>
>What I want is not to call a tcl-function, I want to call a R-function.
>
>For those, who know emacs:
>I want to set the key <F10> to call a eval-region function.
>
>The Rcmdr-Packege by John Fox has exactly the feature I'm looking for. 
>After pressing the button "submit", only the region the user selected 
>would be evaluated.
>
>Can anybody give me a hint?

Take a look at how this is implemented in the Rcmdr package -- it's in the 
code for the local function onSubmit in the Commander function (which is 
right at the top of the R file for the package). You'll see that the 
function does some parsing of the text.

I hope that this helps,
  John
____________________________
John Fox
Department of Sociology
McMaster University
email: jfox at mcmaster.ca
web: http://www.socsci.mcmaster.ca/jfox



More information about the R-SIG-GUI mailing list