Description Usage Arguments Value See Also Examples
The basic dialog is basically a modal window. To use there is a 3
step process: 1) Create a container by calling this constructor,
say dlg
; 2) use dlg
as a container for your
subsequent GUI; 3) set the dialog to be modal by calling
visible(dlg)
. (One can't call visible(dlg)
<- TRUE
.)
We overrided the basic use of visible
for the
gbasicdialog
container to have it become visible and modal
after this call. The better suited call visible(dlg) <-
TRUE
does not work as wanted, for we want to capture the return
value.
dispose method for a basic dialog
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | gbasicdialog(
title = "Dialog",
parent = NULL,
do.buttons = TRUE,
handler = NULL,
action = NULL,
...,
toolkit = guiToolkit()
)
.gbasicdialog(
toolkit,
title = "Dialog",
parent = NULL,
do.buttons = TRUE,
handler = NULL,
action = NULL,
...
)
## S3 method for class 'GBasicDialog'
visible(obj, ...)
## S3 method for class 'GBasicDialog'
dispose(obj, ...)
|
title |
title for window |
parent |
parent to display by |
do.buttons |
FALSE to suppress buttons when no parent |
handler |
handler called when |
action |
passed to handler for OK button |
... |
ignored |
toolkit |
toolkit |
obj |
dialog object |
A GBasicDialog
instance with a visible method
logical indicating which button was pushed (or TRUE if no buttons present)
gmessage
, gconfirm
,
gbasicdialog
, galert
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
## a modal dialog for editing a data frme
fix_df <- function(DF, ...) {
dfname <- deparse(substitute(DF))
w <- gbasicdialog(..., handler=function(h,...) {
assign(dfname, df[,], .GlobalEnv)
})
g <- ggroup(cont=w, horizontal=FALSE)
glabel("Edit a data frame", cont=g)
df <- gdf(DF, cont=g, expand=TRUE)
size(w) <- c(400, 400)
out <- visible(w)
}
m <- mtcars[1:3, 1:4]
fix_df(m)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.