[R] which properly to avoid pointer copy Tcl Tk? 'externalptr'
Cleber N.Borges
klebyn at yahoo.com.br
Wed Oct 12 02:13:26 CEST 2016
hello,
I'm trying to disable an tkentry widget with a tkcheckbutton using an R
function via the command flag.
but I get an error regardding copy of the pointer: 'externalptr'
which properly way to avoid this?
thanks,
cleber
####################
> library( tcltk )
> tp <- tktoplevel()
>
> chk <- tclVar( TRUE )
> statusentry <- tclVar( "normal" ) # normal, disabled
> anystring <- tclVar( "anystring" )
>
> chebut <- ttkcheckbutton( tp, variable=chk, text='Save with new name:
', onvalue=TRUE, offvalue=FALSE,
+ command=function(...) ifelse( as.numeric(tclvalue(chk)),
+ tkconfigure(ent1,'-state','normal'),
+ tkconfigure(ent1,'-state','disabled') )
+ )
> tcl( 'pack', chebut )
<Tcl>
>
> ent1 <- ttkentry( tp, textvariable=anystring, state='normal' )
> tcl( 'pack', ent1 )
<Tcl>
Error in rep(no, length.out = length(ans)) :
attempt to replicate an object of type 'externalptr'
>
---
Este email foi escaneado pelo Avast antivírus.
https://www.avast.com/antivirus
[[alternative HTML version deleted]]
More information about the R-help
mailing list