[R] RGtk2 / gWidgets - addHandlerClicked Problem

Mark Heckmann mark.heckmann at gmx.de
Sun Dec 27 17:29:20 CET 2009


In The following code, the table handler is executed twice when the  
button is pressed (from the 2nd pressing on).
I want it to be executed only once. Does someone know, why this  
happens and how I can change it?

library(gWidgets)

w <- gwindow()
b <- gbutton("press", cont=w)
tbl <- gtable(1:10, cont=w)

addhandlerclicked(b, handler=function(h, ...){
	cat("addhandlerclicked button\n")
	svalue(tbl, index=T) <- 1				# change the table value
})
addhandlerclicked(tbl, handler=function(h, ...){
	cat("addhandlerclicked table\n")
})

Thanks!
Mark

–––––––––––––––––––––––––––––––––––––––
Mark Heckmann
Dipl. Wirt.-Ing. cand. Psych.
Vorstraße 93 B01
28359 Bremen
Blog: www.markheckmann.de
R-Blog: http://ryouready.wordpress.com




More information about the R-help mailing list