My script needs to wait for user input before continuing its processing. After using the R gWidgets package to implement a GUI, I found that the gbasicdialog widget works better than gwindow because it is modal.
The gwindow widget has useful minimize and maximize buttons. The gbasicdialog widget does not have these buttons and I often display large gtables in the GUI, which means the user has to repeatedly click-and-drag to expand the window to see enough of the table.
So far, I adjust the size of the gtable widget as follows:
library(gWidget)
library(gWidgetsRGtk2)
library(RGtk2)
options(guiToolkit = "RGtk2")
mywindow <- gbasicdialog("Display table", do.buttons = FALSE)
# there can be multiple ggroups to one table, which all occupy the gbasicdialog
mygroup <- ggroup(container = mywindow, horizontal = FALSE)
mytable <- gtable(a_data_frame, container = mygroup, expand = TRUE, fill = TRUE)
size(mytable) <- c(500, 500) # or any other large enough dimension
exitbutton <- gbutton("Done", container = mywindow,
handler = function(h, ...) {
#some steps
dispose(mywindow)
})
visible(mywindow, TRUE)
How can I display the maximize/minimize buttons, or display as much of a large widget as possible, for a interactive/modal window?