[R-gui] gWidgetsRGtk2: Problem with gradio handler in a proto object

Gabor Grothendieck ggrothendieck at gmail.com
Fri May 13 13:30:31 CEST 2011


On Fri, May 13, 2011 at 2:37 AM, Yvonnick Noel <yvonnick.noel at uhb.fr> wrote:
> Hello John,
>
> Hope you are doing well.
>
> I note the following problem with the last version of gWidgetsRGtk2.
> Defining a gradio handler as a function embedded in a proto class leads to
> an error :
>
> library(proto)
> library(gWidgetsRGtk2)
>
> example = proto(
>  create = function(.) {
>
>    .$window = gwindow(visible=FALSE)
>    .$choice = gradio(1:3,cont=.$window,handler=.$onChoice)
>    visible(.$window)=TRUE
>  },
>  onChoice = function(.,h,...) {
>    cat("You clicked",svalue(.$choice),"\n")
>  },
>  window = NULL,
>  choice = NULL
> )
>
> example$create()
>
> Error in as(value, "function") :
>  internal problem in as(): "instantiatedProtoMethod" is(object, "function")
> is TRUE, but the metadata asserts that the 'is' relation is FALSE
>
> Note that is works if I define the onChoice function outside the proto
> object, and it also works if a replace the gradio by a gdroplist, so it
> seems specific to gradio.
>
> Thank you in advance for your help.
>
> Best wishes,
>
> Yvonnick Noel
> University of Brittany, Rennes
> France
>

On my system it works even with gradio if gWidgetsRGtk2 is replaced by
gWidgetstcltk.

> packageVersion("gWidgets")
[1] ‘0.0.44’
> packageVersion("gWidgetstcltk")
[1] ‘0.0.43’
> packageVersion("proto")
[1] ‘0.3.9.2’
> R.version.string
[1] "R version 2.13.0 Patched (2011-04-25 r55638)"
> win.version()
[1] "Windows Vista (build 6002) Service Pack 2"


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-SIG-GUI mailing list