[R-gui] R-wxPython Linux progress!

Duncan Temple Lang duncan at wald.ucdavis.edu
Tue Jun 22 17:42:26 CEST 2004


Vaidotas Zemlys wrote:
> Hi,
> >
> >I'm making very small progress with R-wxPython on Linux, but I
> >think my latest progression is quite significant - I can now
> >load:
> >library(wxPython)
> >which initializes a wxPython application and a wxPython frame,
> >and I can then create wx message boxes from the R command line,
> >from e.g.
> >wxMessageBox("Hello!")
> >
> >The problem I was having before appears to be a bug in
> >wxPythonSrc-2.5.1.5/wxPython/src/helpers.cpp
> >
> >In the function
> >wxPyApp::_BootstrapApp()
> >the value of argv passed to wxEntryStart was NULL.
> >
> >A quick and dirty fix which worked for me was:
> >    //PyObject* sysargv = PySys_GetObject("argv");
> >    PyObject* sysargv = Py_BuildValue("[s]", "");
> >
> >All I can do is message boxes so far.  I'm getting some other
> >errors, but I should start making more rapid progress now!
> >
> 
> I've applied your patch recompiled and reinstalled wxPython (only wxPython, 
> not wx library). This time I used debug support:
> 
> python2.2 setup.py build_ext --inplace --debug  WX_CONFIG=/usr/local/share/ 
> wx/2.5/bin/wx-config WXPORT=gtk2 UNICODE=1
> 
> Now
> >.Python("wxRPyApp",.module="testRwxPy")
> 
> in R results in
> 
> 18:20:39: Debug: Adding duplicate image handler for 'Windows bitmap file'
> 18:20:39: Debug: Adding duplicate image handler for 'Windows bitmap file'
> Failing in conversion from Python object: Unhandled case!
> NULL
> 
> Is this suppose to happen?

Yes and no.
It is happening in the interface between Python and R
and it means that it is dealing with transferring
a Python object back to R.  In this particular case,
it is one of the "less usual" but basic types
and the current  RSPython code says
that it is not prepared to deal with that.

Can either of you tell me the Python type of 
the object being converted?
(You can put  a break point in fromPython() in RPythonConverters.c
at the appropriate line (116 in my version).) 
That would help me a great deal as a I can probably easily add
code for that case but want to know what it is and 
I am in the middle of some other work right now so don't
have the time to set this up to debug it.


> 
> Vaidotas
> 
> _______________________________________________
> R-SIG-GUI mailing list
> R-SIG-GUI at stat.math.ethz.ch
> https://www.stat.math.ethz.ch/mailman/listinfo/r-sig-gui

-- 
Duncan Temple Lang                        duncan at wald.ucdavis.edu
 371, Kerr Hall
 University of California at Davis

Phone: (530) 752-4782
FAX:   (530) 752-7099



More information about the R-SIG-GUI mailing list