[R] WinMenu's question

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jun 2 10:30:07 CEST 2004


Ross Darnell wrote:

> I am using the Windows menu functions below which will work on the
> first pass, but if I repeat the same script I cannot get the
> WinMenuAddItem to work. This is a problem if I change the menu
> structure and reread the source code I am forced to quit and restart Rgui.
> 
> "try.menu" <- function(){
>   OS <- .Platform$OS.type
>   GUI <- .Platform$GUI
>   if (!(OS == "windows" & GUI == "Rgui")) return("Sorry, you must be running R using Rgui.exe on MS Windows")
>   try(winMenuDelItem('EMG/Graphics','Plot.trace'))
                                            ^ note the dot

>   try(winMenuDel('EMG/Graphics'))
>   try(winMenuDel("EMG"))
>   winMenuAdd("EMG")
>   winMenuAdd("EMG/Graphics")
>   winMenuAddItem("EMG/Graphics","Plot trace","plot.trace()")
                                        ^ note the blank


Uwe Ligges


> }
> "plot.trace" <- function(){
>   x <- eval(parse(text=trace.dialog()))
>   plot(x,type="l")
>   invisible()
> }
> 
> 
> Help much appreciated
> 
> Ross Darnell




More information about the R-help mailing list