As per the suggestions in the comments, I can either via b4$invoke_change_handler()
. Or by redefining the handler as a separate function:
w <- gwindow("Buttons", visible=FALSE)
g <- ggroup(cont=w, horizontal=FALSE)
## various buttons
## without icon
h2 <- function(h,...) {
if(svalue(b2) == "open")
svalue(b2) <- "ouvrir"
else
svalue(b2) <- "open"
}
b2 <- gbutton("ouvrir", cont=g)
## with a handler
b4 <- gbutton("click me", cont=g, handler=h2)
visible(w) <- TRUE
and then calling that: h2()
.