[GRASS-dev] how to start wx vdigit?

Martin Landa landa.martin at gmail.com
Sun Mar 9 15:43:01 EDT 2008


2008/3/9, William Kyngesburye <woklist at kyngchaos.com>:
>  I wanted to start with an empty vector map, so I tried to create one
>  from the GUI.  Error in console:
>  Traceback (most recent call last):
>    File "/Applications/GRASS-6.3.app/Contents/MacOS/etc/wxpython/
>  wxgui.py", line 433, in OnMenuCmd
>      menuform.GUI().ParseCommand(cmd, parentframe=self)
>    File "/Applications/GRASS-6.3.app/Contents/MacOS/etc/wxpython/
>  gui_modules/menuform.py", line 1390, in ParseCommand
>      get_dcmd=get_dcmd, layer=layer)
>    File "/Applications/GRASS-6.3.app/Contents/MacOS/etc/wxpython/
>  gui_modules/menuform.py", line 608, in __init__
>      mainFrame=self)
>    File "/Applications/GRASS-6.3.app/Contents/MacOS/etc/wxpython/
>  gui_modules/menuform.py", line 1050, in __init__
>      txt3.SetValue(p['value']) # parameter previously set
>    File "/BinaryCache/wxWidgets/wxWidgets-11~57/Root/System/Library/
>  Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-
>  unicode/wx/_controls.py", line 2249, in SetValue
>  TypeError: in method 'SpinCtrl_SetValue', expected argument 2 of type
>  'int'

Now fixed in trunk, http://trac.osgeo.org/grass/changeset/30510

>  Now, added to the GUI display list, right-click (yes, the toolbar
>  combo box is not there), start editing, and I get a dialog:
>  "
>  Unable to initialize display driver, see README file for more info.
>  Details: 'NoneType' object has no attribute 'OpenMap' (dynamic module
>  does not define init function (init_grass6_wxvdigit))
>  "

important is the last part of the message which comes when you try to
import grass6_wxvdigit Python module .


cd gui/wxpython/vdigit
import grass6_wxvdigit

you will get this error

>  It looks like the vdigit toolbar appears, and stays up, but the
>  display list contextual menu still says "start editing" (stop is
>  disabled), so it's probably not fully initialized, as the error says.

The problem is loading python module itself.

>  I'm not sure if this is from the way I setup my test build or
>  something else.
>  Here is what I did to get it compiled: since _gdi_.so is technically
>  an extension to [wx]Python, I figure that it should get loaded (maybe
>  automatically?) by wxPython.  So instead of directly linking it into
>  vdigit, I used an OSX linker flag "-undefined dynamic_lookup" to tell
>  the linker that the gdi.so symbols will be found at runtime.

Hm, the last days I have not so much time to work on this, the way you
suggest maybe could solve it.

>  But, I'm not sure it gdi is guaranteed to be loaded.  Maybe it needs
>  something in the vdigit code to trigger loading the extension,
>  equivalent to import in Python code?  Or maybe import it in
>  grass6_wxvdigit.py, before importing _grass6_wxvdigit.so?


Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *

More information about the grass-dev mailing list