[GRASS-user] Another error with wxpython GUI in RC6

Martin Landa landa.martin at gmail.com
Sat Apr 12 10:33:01 EDT 2008


2008/4/11, Peter Gardner <geep999 at yahoo.co.uk>:

>   File "/usr/local/grass-6.3.0svn/etc/wxpython/gis_set.py",
> line 561, in OnSelectLocation
>     self.lbmapsets.SetSelection(0)
>   File
> "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
> line 1325, in SetSelection
>     return _controls_.ListBox_SetSelection(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "IsValid(n)" failed at
> ../src/gtk/listbox.cpp(859) in DoSetSelection(): invalid index in
> wxListBox::SetSelection

well, according to [1], SetSelection() should unselect item if n ==
wx.NOT_FOUND, it seems to me a bug in wxWidgets itself. Anyway,
location should contain at least one mapset (PERMANENT), so
SetSelection(0) should not fail because 'self.lbmapsets' contains at
least one item.

Module 'gis_set.py' (welcome screen) in releasebranch_6_3 uses
wx.ListBox for list of locations/mapsets, in trunk is used subclassed
wx.ListCtrl (to enable different style for mapset without user
permission). It is not backported to releasebranch_63 (missing
'g.mapset -l').

Please, try the attached patch, but it is just workaround... Helps?

[1] file:///usr/share/doc/wx2.8-doc/wx-manual.html/wx_wxcontrolwithitems.html#wxcontrolwithitemssetselection
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa *
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gis_set-PyAssertionError.diff
Type: text/x-diff
Size: 503 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20080412/895d6f70/gis_set-PyAssertionError.bin

More information about the grass-user mailing list