inst/Examples/ch-gWidgets/ex-gWidgets-basic-popup-menu.R

###################################################
### code chunk number 138: Controls.Rnw:1554-1565
###################################################
window <- gwindow("Popup example")
button <- gbutton("click me or right click me", cont = window, 
                  handler = function(h, ...) {
                    cat("You clicked me\n")
                  })
f <- function(h,...) cat("you right clicked on", h$action, "\n")
menu_bar_list <- 
  list(one = gaction("one", action = "one", handler = f),
       two = gaction("two", action = "two", handler = f)
       )
add3rdMousePopupmenu(button, menu_bar_list)

Try the ProgGUIinR package in your browser

Any scripts or data that you put into this service are public.

ProgGUIinR documentation built on May 2, 2019, 4:04 p.m.