I am creating a fairly simple GUI in R that creates figures of different data analysis based on values selected by a user. I am having trouble figuring out how to enable a user to select multiple values from a list. The method I am working on is below. The problem area is in the if statement which is where I need to place the user selections into a list.
CallSpecies<-function(options){
dialog<-gtkMessageDialog(NULL,0,"question","ok-cancel","Choose a species",show=FALSE)
sppmodel<-rGtkDataFrame(Species)
sppview<-gtkTreeView(sppmodel)
sppview$getSelection()$setMode("multiple")
column<-gtkTreeViewColumn("Species Code",gtkCellRendererText(),text=0)
column1<-gtkTreeViewColumn("Common Name",gtkCellRendererText(),text=1)
sppview$appendColumn(column)
sppview$appendColumn(column1)
scrolled_window<-gtkScrolledWindow()
scrolled_window$setSizeRequest(-1,150)
scrolled_window$add(sppview)
dialog[["vbox"]]$add(scrolled_window)
if (dialog$run()==GtkResponseType["ok"]){
}
dialog$destroy()
}