Sarthi,

See help(gSignalConnect) for instructions on how to connect to GObject
signals.
For this particular case, try gSignalConnect(butt, "clicked", function(wid)
print("clicked!")).
See the demos included in the RGtk2 paper for numerous examples of using
gSignalConnect().

Michael

On 3/13/07, hadley wickham <h.wickham@gmail.com> wrote:
>
> ---------- Forwarded message ----------
> From: d. sarthi maheshwari <samay.sar@gmail.com>
> Date: Mar 13, 2007 5:41 AM
> Subject: [R] gtk button: how to create signal handler?
> To: r-help@stat.math.ethz.ch
>
>
> 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?
>
> Thanks in advance.
>
> --
> Regards
> Sarthi M.
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
>

	[[alternative HTML version deleted]]

