Displaying 2 results from an estimated 2 matches for "evresp2".
2025 Jan 20
1
[tcltk] binding two functions to one event
Here is some tcl/tk code I am trying to emulate in R.
Paste the following into wish
### begin tcl code
toplevel .wtop
proc evresp1 { data } { puts "evresp1 $data" }
proc evresp2 { data } { puts "evresp2 $data" }
bind all <<EVENT>> "evresp1 %d"
bind all <<EVENT>> "+evresp2 %d"
### end tcl code
Now paste
event generate .wtop <<EVENT>> -data abcdef
I see the output
evresp1 abcdef
evresp2 abcdef
Both evresp1...
2025 Jan 21
1
[tcltk] binding two functions to one event
..... +script is syntactically an operator or part of the command.
However, it is usually not right to define named functions on the Tcl side and mix them with the ones R/Tcl interface generate.
So I am thinking that if tkbind('all','<<EVENT>>',evresp1) works, then to add evresp2, you just need to get a "+" into whatever the evresp2 gets converted to.
And...
> tkbind('all','<<EVENT>>',evresp1)
<Tcl>
> tkbind('all','<<EVENT>>',paste0("+", .Tcl.callback(evresp2)))
<Tcl>
> tk...