Amitoj S. Chopra <amitojc <at> gmail.com> writes:

> 
> 
> Hello to everyone.
> 
> I am constructing a GUI table using traitr with multiple buttons that
> respond to different codes. Such as I am doing titration of a protein, and I
> want the script to run and then the end to be displayed in a window. The
> window will have a button for data and graphs, where when you click on the
> data button the data will be displayed and when you click on the graph
> button the graphs will be displayed. Do you know how to set up different
> buttons with functions using the traitr GUI for R? Thanks!

There are two ways. You can use a buttonItem or to add a button to a dialog,
just use the buttons property and define a handler. Here are both in an example:


dlg <- aDialog(items=list(a = buttonItem("click me", show_label=FALSE,
                            action=function(.,...) print("clicked"))
                 ),
               buttons=c("OK","Cancel","Help","Some other"),
               Someother_handler=function(.) print("some other button"))
dlg$make_gui()

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to