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. > > ______________________________________________ R-help@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.