-1

I've got this error while running the demo of the gWidgets2Qt package:

> demo(gWidgets2Qt)


    demo(gWidgets2Qt)
    ---- ~~~~~~~~~~~

Type  <Return>   to start : 

> ## run examples
> require(gWidgets2)

> options(guiToolkit="Qt")

> ## run examples
> source(system.file("examples", "run_examples.R", package="gWidgets2"))
Error in envRefSetField(x, what, refObjectClass(x), selfEnv, value) : 
  ‘.visible’ is not a field in class “GWindow”

please check also this question I've just asked for session info and a similar error I've got with the cranvas package which I think might be related to the above. Thanks a lot.

EDIT:

following the tips from @jverzani I tried a simple code which worked. Then I did some tests:

I get this when detaching the package

detach("package:gWidgets2Qt", unload=TRUE)
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In FUN(X[[2L]], ...) :
  Created a package name, ‘2013-05-23 07:40:37’, when none found

Tried to re-load and run the demo but still didn't work I restarted ubuntu and tried again

library(gWidgets2Qt)
demo(gWidgets2Qt)

it run correctly, I only get error with the ex-graphics.R example which fails to run with this error at the first attempt:

Error in qsceneDevice(width, height, pointsize, family, the_scene) : 
  unused argument (the_scene)
In addition: Warning message:
In .removePreviousCoerce(class1, class2, where, prevIs) :
  methods currently exist for coercing from “AlternativeSingleEnum” to “character”; they will be replaced.
Error in qinvoke(<environment>, "initScene", ...) : 
  Implementation failed for method 'R::gWidgets2Qt::QtDevice::initScene'

and this one at the next attmpts:

Error in qsceneDevice(width, height, pointsize, family, the_scene) : 
  unused argument (the_scene)
Error in qinvoke(<environment>, "initScene", ...) : 
  Implementation failed for method 'R::gWidgets2Qt::QtDevice::initScene'

But all the other examples work. However, as soon as I load cranvas, with

> library(cranvas)

Attaching package: ‘cranvas’

The following object is masked from ‘package:gWidgets2’:

    visible, visible<-

demo(gWidgets2Qt) fails again and detaching cranvas

> detach("package:cranvas", unload=TRUE)
There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In FUN(X[[2L]], ...) :
  Created a package name, ‘2013-05-23 08:37:43’, when none found

demo(gWidgets2Qt) runs again. Has been this incompatibility already seen? Is this depending on invisible being masked from gWidgets2?

Community
  • 1
  • 1
Michele
  • 8,563
  • 6
  • 45
  • 72
  • I'm really curious to know the reason for the downvote...in case he/she is able. the question is asked correctly and gives enough info to be answered I think!!! – Michele May 22 '13 at 22:55

1 Answers1

1

I'm not sure why this isn't working. I just installed the whole thing (qtbase, qtutils, gWidgets2, gWidget2Qt) on a linux setup and the demo starts. The ones involving graphs don't really work, but the basic demo does. To see if everything is working, try with something simple:

w <- gwindow("something simple")
b <- gbutton("click me", container=w)
addHandlerChanged(b, handler=function(h,...) {
  gmessage("Hello world", parent=w)
})

If that doesn't work then there are installation issues

jverzani
  • 5,600
  • 2
  • 21
  • 17
  • Yep it worked. I've got something maybe, please check the edit. ps: many thanks for your time! – Michele May 23 '13 at 07:04
  • 1
    The order of loading is important. Load cranvas, then gWidgets2 otherwise the visible methods are masked. This isn't such an issue in user-written code, as you should be able to reference the appropriate method through gWidgets2::visible. – jverzani May 23 '13 at 11:49
  • right! I'll try this evening at home... just windows in here :-) – Michele May 23 '13 at 12:51
  • Thanks very much! no more issues related to `visible`. – Michele May 23 '13 at 21:49