[R] gtk button: how to create signal handler?
jverzani
jverzani at gmail.com
Tue Mar 13 17:37:36 CET 2007
d. sarthi maheshwari <samay.sar <at> gmail.com> writes:
>
> Hi
>
> Kindly correct me if I am posting a wrong query in the forum.
>
> I am trying to handle my "button:clicked" event. But not able to proceed
> further. Please help.
> Following is my code:
>
> library(RGtk2)
>
> win <- gtkWindowNew(type = NULL, show = TRUE)
> butt <- gtkButtonNewWithLabel("Submit", show = TRUE)
> win$Add(butt)
>
> Now I want to do something when my button is clicked. How can I grab the
> "clicked" signal and define actions against it?
>
Dear Sarthi,
If you aren't in need of the full power of GTK (which Michael's suggestion gives
you), you might want to look at the gWidgets and gWidgetsRGtk2 package which
simplify GUI construction a bit:
require(gWidgets)
gbutton("submit", cont=gwindow("example"), handler=function(h,...) {
cat("your action goes here\n")
})
The gWidgets package has a vignette with more demos.
--John
> Thanks in advance.
>
> --
> Regards
> Sarthi M.
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help <at> stat.math.ethz.ch 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.
>
>
More information about the R-help
mailing list