buttonItem(value="button label", action, name, label=name, help="",
tooltip="", attr, model, editor, ...)
function(., h, ...) {}
(like gWidgets with extra leading
.
). The ".
" is the button item, not the itemgroup or
dialog that this item may be a part of. When that is the caseattr=list(size=c(100,200))
proto
object. Call obj$show_help()
to view its methods and properties.buttons
property for the main buttons,
this item allows other buttons to be used within a dialog. One
must define an action (a callback) to call when the button is
clicked. There are some issues with how this method is defined and
where it is evaluated.Item
## basic button. Note the extra "." compared to gWidgets handler
b <- buttonItem("click me", action=function(.,h,...) {
print("hi")
})
## An example within a dialog
dlg <- aDialog(items=list(
a = stringItem(""),
b = buttonItem("Click me", label="", action=function(., h, ...) {
galert(sprintf("Item a is %s
", .$parent$get_a()))
})
),
title="A dialog with a button item",
buttons=c() # no standard buttons
)
dlg$make_gui()
Run the code above in your browser using DataLab