Description Usage Arguments Value See Also Examples
While dialogs have a 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.
1 2 |
value |
Default value for the model |
action |
function to call when clicked. Signature is
|
name |
Required name for object. Names should be unique within a group of items |
label |
Optional label, default value is the name. Use "" to have not label text. |
help |
Optional help string |
tooltip |
Optional tooltip to display |
attr |
A list of attributes to pass to widget on construction. Eg. |
model |
Optional model. Useful if one wishes to use same model for multiple views |
editor |
Specification of editor (a view) to override default |
... |
Passed to parent proto object during call to proto |
A proto
object. Call obj$show_help()
to view its methods and properties.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## 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\n", .$parent$get_a()))
})
),
title="A dialog with a button item",
buttons=c() # no standard buttons
)
## Not run: dlg$make_gui()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.