[R-gui] Tcl/Tk Binding % Substitutions.for Callbacks

Roebuck,Paul L proebuck at mdanderson.org
Wed Feb 23 20:49:47 CET 2011


<previously misfiled in r-devel...>

How are % substitutions handled for callbacks in R?
Is there an 'event' parameter that can be requested
which would contain the rest of the information specific
to the event type itself?

How should we translate something like the following:

Tcl> bind Frame <Enter> {%W config -bg red}
Tcl> bind Frame <Leave> {%W config -bg white}

such that the widget id (and other % substitutions) can be accessed
in R callback? I'm trying to write callback handlers for dynamic
bindtags.

one   <- tkframe(width=30, height=30)
two   <- tkframe(width=30, height=30)
three <- tkframe(width=30, height=30)
tkbind("Frame",
       "<Enter>",
       function(TBD} {
           ## How do I determine widget id (%W) here?
       })



More information about the R-SIG-GUI mailing list