Mark Heckmann <mark.heckmann <at> gmx.de> writes: > > > I want to assign a default handler to a toolbar button and change the > handler later. > The addhandlerclicked() method does not apply to a gAction Object, I > think... > > defHandler <- function(h, ...) print("default") > w <- gwindow() > aTest <- gaction(label="Test", icon="open", handler=defHandler) > tblList = list( test = aTest ) > toolBar = gtoolbar(tblList, cont=w) >
There should be a method to do this, but for now there isn't. A workaround would be to have the default handler call a function which can be redefined during the flow of the program: f <- function(h,...) print("default") defHandler <- function(h, ...) f(h,...) The RGtk2 way would be to remove the handler and add a new one, but even that isn't so easy, as the id isn't stored at the moment. --John > At this point I would like to change the handler from the aTest object. > Does someone know? > > TIA > Mark > > ––––––––––––––––––––––––––––––––––––––– > Mark Heckmann > Dipl. Wirt.-Ing. cand. Psych. > Vorstraße 93 B01 > 28359 Bremen > Blog: www.markheckmann.de > R-Blog: http://ryouready.wordpress.com > > ______________________________________________ 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.