Skip to content
Prev 33506 / 63424 Next

options( "menu" )

Hello,

The current implementation of the menu function (in utils) makes it 
difficult for front-ends to hook in and propose an alternative display.

Can there be something like options( "menu" ) to give control over it in 
case graphics = TRUE. The default could be then be factored out of the 
current menu :

default.menu <- function( choices, multiple = FALSE, title ){
	if(.Platform$OS.type == "windows" || .Platform$GUI == "AQUA") {
             res <- select.list(choices = choices, multiple=multiple, 
title=title)
             return(match(res, choices, nomatch = 0L))
         } else if(.Platform$OS.type == "unix"
                 && capabilities("tcltk") && capabilities("X11")
                 && nzchar(Sys.getenv("DISPLAY"))) {
             res <- tcltk::tk_select.list(choices, multiple=multiple, 
title=title)
             return(match(res, choices, nomatch = 0L))
         }
options( menu = default.menu )

... or maybe this should be done at the select.list level

Romain