Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3112 closed defect (fixed)

wxgui scatterplot tool: C++ assertion "m_window" failed at ../src/gtk/dcclient.cpp(2043) in DoGetSize(): GetSize() doesn't work without window

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.0.5
Component: wxGUI Version: svn-trunk
Keywords: scatterplot Cc:
CPU: Unspecified Platform: Unspecified

Description

Trying to use the bivariate scatterplot tool in the Map Display I get the following error and nothing else:

Traceback (most recent call last):
  File
"/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/mapdisp/frame.py", line 1175, in
OnScatterplot

win = ScatterFrame(parent=self, rasterList=raster)
  File
"/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/wxplot/scatter.py", line 42, in
__init__

BasePlotFrame.__init__(self, parent, size=size, **kwargs)
  File
"/data/home/mlennert/SRC/GRASS/grass_trunk/dist.x86_64-pc-
linux-gnu/gui/wxpython/wxplot/base.py", line 113, in
__init__

self.client.canvas.Bind(wx.EVT_LEFT_DOWN,
self.OnMouseLeftDown)
  File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/_core.py", line 4228, in Bind

event.Bind(self, id, id2, handler)
  File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/_core.py", line 4572, in Bind

target.Connect(id1, id2, et, function)
  File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/_core.py", line 4182, in Connect

return _core_.EvtHandler_Connect(*args, **kwargs)
wx._core
.
PyAssertionError
:
C++ assertion "m_window" failed at
../src/gtk/dcclient.cpp(2043) in DoGetSize(): GetSize()
doesn't work without window

Maybe linked to wx 3 ?

Attachments (2)

wxlibplot.py (98.2 KB ) - added by annakrat 8 years ago.
modified plot.py
wxlibplot_imports.diff (2.4 KB ) - added by annakrat 8 years ago.
changes in imports

Download all attachments as: .zip

Change History (11)

comment:1 by pvanbosgeo, 8 years ago

I can confirm that the bivariate scatterplot tool in the Map Display is not working (grass 7.3svn, r69054, python 2.7.12, wxpython 3.0.2.0, ubuntu 16.04). The error I got is slightly different, so adding below.

Traceback (most recent call last):
  File "/usr/local/grass7/grass-7.3.svn/gui/wxpython/mapdisp
/frame.py", line 1174, in OnScatterplot

win = ScatterFrame(parent=self, rasterList=raster)
  File "/usr/local/grass7/grass-7.3.svn/gui/wxpython/wxplot/
scatter.py", line 42, in __init__

BasePlotFrame.__init__(self, parent, size=size, **kwargs)
  File "/usr/local/grass7/grass-7.3.svn/gui/wxpython/wxplot/
base.py", line 107, in __init__

self.client = plot.PlotCanvas(self)
  File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/lib/plot.py", line 598, in __init__

self.HandCursor = wx.Cursor(Hand.GetImage())
  File "/usr/lib/python2.7/dist-
packages/wx-3.0-gtk2/wx/_gdi.py", line 1510, in __init__

_gdi_.Cursor_swiginit(self,_gdi_.new_Cursor(*args,
**kwargs))
TypeError
:
Required argument 'type' (pos 2) not found

in reply to:  description ; comment:2 by annakrat, 8 years ago

Replying to mlennert:

Trying to use the bivariate scatterplot tool in the Map Display I get the following error and nothing else:

Please check if you have any local changes. I've seen this error when I was experimenting with #2558.

in reply to:  2 comment:3 by mlennert, 8 years ago

Replying to annakrat:

Replying to mlennert:

Trying to use the bivariate scatterplot tool in the Map Display I get the following error and nothing else:

Please check if you have any local changes. I've seen this error when I was experimenting with #2558.

I just compiled a completely fresh checkout of trunk now. I don't think that the python-wx had any local modifications.

But the issue seems to be known:

Apparently some inconsistencies in python-wx3, IIUC.

The latest Debian version that I use actually includes a bugfix for the lib/plot.py:

http://metadata.ftp-master.debian.org/changelogs//main/w/wxpython3.0/wxpython3.0_3.0.2.0+dfsg-3_changelog

based on a patch proposed in Launchpad:

https://bugs.launchpad.net/ubuntu/+source/wxpython3.0/+bug/1545698

which gets rid of the problem reported in #2558, but now I see the problem reported here...

comment:4 by annakrat, 8 years ago

Then it makes sense, your version of wxPython has fixed the original problem, but now a different problem appears (apparently only for wxGTK). There are some clues in the ticket you link, but I am not sure if it helps. If I can reproduce it on my system I'll try to look at it.

by annakrat, 8 years ago

Attachment: wxlibplot.py added

modified plot.py

comment:5 by annakrat, 8 years ago

I modified the plot.py based on the information in the ticket and now it works for me, please test. I added it to gui_core and change all imports to: import gui_core.wxlibplot as plot

by annakrat, 8 years ago

Attachment: wxlibplot_imports.diff added

changes in imports

in reply to:  5 comment:6 by mlennert, 8 years ago

Replying to annakrat:

I modified the plot.py based on the information in the ticket and now it works for me, please test. I added it to gui_core and change all imports to: import gui_core.wxlibplot as plot

Beautiful, Anna ! This solves the issue (and so also #2558) and I now have all these great tools back: profile, histogram, and scatterplot !!

Thank you very much for looking into this !

comment:7 by annakrat, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in r69075 (and backported in r69076 and r69077). wxPython file wx.lib.plot.py (the fixed version, see http://trac.wxwidgets.org/ticket/16767) is now distributed with GRASS and modified to workaround this bug specific for wxGTK only: http://trac.wxwidgets.org/ticket/17293

in reply to:  7 ; comment:8 by mlennert, 8 years ago

Replying to annakrat:

Fixed in r69075 (and backported in r69076 and r69077). wxPython file wx.lib.plot.py (the fixed version, see http://trac.wxwidgets.org/ticket/16767) is now distributed with GRASS and modified to workaround this bug specific for wxGTK only: http://trac.wxwidgets.org/ticket/17293

I imagine that this should only be temporary: as soon as the bug is fixed in a new wxpython distribution, we should not maintain that code in our code base.

in reply to:  8 comment:9 by annakrat, 8 years ago

Replying to mlennert:

Replying to annakrat:

Fixed in r69075 (and backported in r69076 and r69077). wxPython file wx.lib.plot.py (the fixed version, see http://trac.wxwidgets.org/ticket/16767) is now distributed with GRASS and modified to workaround this bug specific for wxGTK only: http://trac.wxwidgets.org/ticket/17293

I imagine that this should only be temporary: as soon as the bug is fixed in a new wxpython distribution, we should not maintain that code in our code base.

Yes, the problem is nobody knows if and when classic wxPython 3 is released.

Note: See TracTickets for help on using tickets.