I'm make GUI with a pop up menu with right click, over a graphic but at the same time appear a pop up menu with the options copy or save graphics, how i can delete this last pop up menu?
library(cairoDevice)
library(ggplot2)
library(gWidgets)
library(gWidgetsRGtk2)
require(RGtk2)
plot1<-ggplot(mtcars, aes(wt, mpg))+ geom_point(colour = "black", size = 3)
plot2<-ggplot(mtcars, aes(wt, mpg))+geom_point(colour = "red", size = 3)
plot3<- ggplot(mtcars, aes(wt, mpg))+ geom_point(colour = "yellow", size = 3,shape=20)
options(guiToolkit = "RGtk2")
w <-gwindow("GUI")
g <-ggroup(cont=w)
graphic1 <- ggraphics(cont=g)
print(plot1)
ml<-list()
ml$plot2<- list(handler=function(h,...){
svalue(graphic1)<- print(plot2)
})
ml$plot3<- list(handler=function(h,...){
svalue(graphic1)<-print(plot3)
})
add3rdMousePopupmenu(obj=graphic1,menulist=ml,action=graphic1)`
There are some hidden arguments for ggraphics under RGtk2. Try passing no_popup=TRUE
to the ggraphics constructor. If you want to remove rubber banding, the argument to pass is do.rubber.banding=FALSE
(why . for one, _ for the other? don't ask...)