[GRASS-dev] [GRASS GIS] #532: Vector editing not possible with wx tools

#532: Vector editing not possible with wx tools
---------------------------+------------------------------------------------
Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Keywords: vector, digit | Platform: Linux
      Cpu: x86-32 |
---------------------------+------------------------------------------------
When you start editing a vector with wx interface you get in the command
output:

Traceback (most recent call last):
File "/home/user/releasebranch_6_4/dist.i686-pc-linux-
gnu/etc/wxpython/gui_modules/wxgui_utils.py", line 512, in
OnStartEditing

self.mapdisplay.toolbars['vdigit'].StartEditing (maplayer)
File "/home/user/releasebranch_6_4/dist.i686-pc-linux-
gnu/etc/wxpython/gui_modules/toolbars.py", line 1099, in
StartEditing

self.parent.digit = Digit(mapwindow=self.parent.MapWindow)
File "/home/user/releasebranch_6_4/dist.i686-pc-linux-
gnu/etc/wxpython/gui_modules/vdigit.py", line 685, in
__init__

VDigit.__init__(self, mapwindow)
File "/home/user/releasebranch_6_4/dist.i686-pc-linux-
gnu/etc/wxpython/gui_modules/vdigit.py", line 223, in
__init__

mapwindow)
File "/home/user/releasebranch_6_4/dist.i686-pc-linux-
gnu/etc/wxpython/vdigit/grass6_wxvdigit.py", line 327, in
__init__

this = _grass6_wxvdigit.new_Digit(*args)
TypeError
:
in method 'new_Digit', argument 2 of type 'wxWindow *'

The monitor gets erased and editing it is not possible

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by martinl):

Which version of swig do you use?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by geognu1):

Replying to [comment:1 martinl]:
> Which version of swig do you use?

SWIG Version 1.3.38
Compiled with g++ [i686-pc-linux-gnu]

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by neteler):

Here a recent note from grass-user (copied here for reference):

On Mon, Mar 16, 2009 at 6:13 AM, Huidae Cho wrote:
> After investing some time, I found a note in
> swig-1.3.38/Tools/pyname_patch.py saying that they have renamed PySwig*
> to SwigPy* since swig 1.3.37. wxPython 2.8.9.2 (current stable version)
> still uses old naming, so we have to stick to swig >= 1.3.31 and <=
> 1.3.36. Now, GUI works great!

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: Linux | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by geognu):

No way. Downgraded swig to v. 1.3.36, still get the same message.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by cmbarton):

  * platform: Linux => All

Comment:

I cannot do any digitizing on 6.4 on the Mac OSX platform. As soon as I
try to select a map to digitize in the pull down, the GUI crashes. This
happens if I try to select an existing map or create a new map.

Digitizing works with 6.5 on my Mac.

This remains a serious issue for a 6.4 release.

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by kyngchaos):

I just tried with 6.4svn (from earlier in the week) built with Snow's
Python 2.6.1 and my own wxpython 2.8.10.1 and digitizing works. I'm sure
it worked for me on OSX 10.5 with 6.4rc5, the system python 2.5 and wx
2.8.10.1.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by cmbarton):

This works fine for me now on the Mac. I have swig 1.3.31.

My problem was probably due to a second Python installation that was not
completely removed. This caused problems during compiling that affected
the digitizing module, especially the one creating the local PsuedoDC. It
is not a problem if the wxpython used to compile is bundled with the app
on the Mac. For other reasons, we will need to do this regularly if we
want digitizing to work with portable binaries.

Is this a problem on other systems with swig 1.3.31?

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by cmbarton):

Can we close???

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Changes (by martinl):

* cc: martinl (added)

Comment:

Replying to [comment:8 cmbarton]:
> Can we close???

I don't think so. The problem still remains in different forms, but
usually it's cause by incompatible version of swig and wxPython.

Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by cmbarton):

Then isn't this really something that needs to be fixed in compiling? I
don't think this is really a wxGUI issue is it?

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/532#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by hamish):

Replying to [comment:4 geognu]:
> No way. Downgraded swig to v. 1.3.36, still get the same
> message.

still seeing it with the latest svn?
what linux distro/version are you using?

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:11&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by geognu):

Didn't try the latest svn, but AFAIK problems still arise with wx
interface on grass 6.4.0rc5 (shipped with Ubuntu Karmic):
grass -wx
Cleaning up temporary files ...
Starting GRASS ...
Traceback (most recent call last):
   File "/usr/lib/grass64/etc/wxpython/gis_set.py", line 33, in <module>
     from gui_modules import globalvar
   File "/usr/lib/grass64/etc/wxpython/gui_modules/globalvar.py", line 55,
in <module>
     CheckForWx()
   File "/usr/lib/grass64/etc/wxpython/gui_modules/globalvar.py", line 44,
in CheckForWx
     except (ImportError, ValueError, wxversion.VersionError), e:
UnboundLocalError: local variable 'wxversion' referenced before assignment
Error in GUI startup. If necessary, please
report this error to the GRASS developers.
Switching to text mode now.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:12&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by hamish):

6.4.0rc5 is like 6 months old now, hundreds of fixes since then,
especially to the wx gui. hopefully we will see a rc6 soon.
(debian/unstable has packages with modern 6.4.SVN snapshots btw)

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:13&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by neteler):

Replying to [comment:11 hamish]:
> Replying to [comment:4 geognu]:
> > No way. Downgraded swig to v. 1.3.36, still get the same
> > message.
>
> still seeing it with the latest svn?
> what linux distro/version are you using?

Also for me it fails *since* RC5. Despite a locally downgraded swig to v.
1.3.36,
no way to get the GUI up if wx-nviz and wx-vdigit are present. A real
showstopper
to showcase the new GUI...

I have no clue how to debug this issue.

Markus

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:14&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by glynn):

Replying to [comment:14 neteler]:

> Also for me it fails *since* RC5.

With a "'wxversion' referenced before assignment" error?

There has been an attempt at fixing that, but I'm still not sure that it's
correct. I think that !CheckForWx() should look like:
{{{
try:
     import wxversion
     try:
         wxversion.select(...)
         import wx
         # the rest of CheckForWx() goes here
         ....
     except wxversion.VersionError, e:
         ...
except ImportError, e:
     ...
}}}

Any references to wxversion should only appear in the same scope as the
"import wxversion", not in any outer scope.

> Despite a locally downgraded swig to v. 1.3.36,
> no way to get the GUI up if wx-nviz and wx-vdigit are present. A real
showstopper
> to showcase the new GUI...

For release candidates and any eventual release, I strongly suggest
building `--without-wxwidgets`. It's not worth the risk of losing the
whole wxGUI over those two modules.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:15&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by neteler):

Replying to [comment:15 glynn]:
> Replying to [comment:14 neteler]:
>
> > Also for me it fails *since* RC5.
>
> With a "'wxversion' referenced before assignment" error?

It fails silently. Also when using 'g.gui wxpython': the old map flashed,
then return to command line and nothing else.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:16&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by cmbarton):

Markus,

We had identical symptoms on Linux machines. The cause for use was not in
wxpython but in GDAL. If the GUI cannot get projection information, it
cannot start. Isaac corresponded with you about this. There has been a
problem with GRASS recognizing a linked *.so file (I can't remember which
one, but you might find it in your back email.)

Michael

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:17&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by hamish):

Replying to [comment:16 neteler]:
> Also when using 'g.gui wxpython': the old map flashed,
> then return to command line and nothing else.

hmm, I just saw that myself on startup.

I ran g.gui at the terminal prompt and it worked fine from there.

?,
Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:18&gt;
GRASS GIS <http://grass.osgeo.org>

#532: Vector editing not possible with wx tools
----------------------+-----------------------------------------------------
  Reporter: geognu1 | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: wxGUI | Version: 6.4.0 RCs
Resolution: | Keywords: vector, digit
  Platform: All | Cpu: x86-32
----------------------+-----------------------------------------------------
Comment (by cmbarton):

There are 2 possibly related or possibly unrelated errors going on here.

1) GUI just doesn't start
2) GUI attempts to start (flashes on screen) but fails and quits

To get started on debugging this, can someone tell me where exactly is the
code that launches the GUI?

Michael

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/532#comment:19&gt;
GRASS GIS <http://grass.osgeo.org>