Dear,
is there any way of a button on pure TCL run a command within the R via the tcltk package?
thank you in advance for informations
cleber
what I have in mind is something like:  (below)
##########################################################################################
sink("simpletest.tcl")
cat('
toplevel .t
button .t.b -text "but" -command {"some tcltk command for push data into R"}
checkbutton .t.c -text "ck1" -variable "chkvar"
pack .t.b
pack .t.c '
)
sink()

library( tcltk )
#tcl('set', 'argc', '0')
#tcl('set', 'argv', '0')
tcl('source', "simpletest.tcl" )

> tclvalue('chkvar')
[1] "1"
> tclvalue('chkvar') # after click in screen
[1] "0"
>

### after click in button  get error:

invalid command name "some tcltk command for push data into R"
invalid command name "some tcltk command for push data into R"
    while executing
""some tcltk command for push data into R""
    invoked from within
".t.b invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 24)
    invoked from within
"tk::ButtonUp .t.b"
    (command bound to event)
 
##########################################################################################
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7600)

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] tcltk stats graphics grDevices utils datasets methods base
>



---
Este email foi escaneado pelo Avast antivĂ­rus.
https://www.avast.com/antivirus

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to