Hi,
2008/4/11, Peter Gardner <[EMAIL PROTECTED]>:
[...]
> 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 *
Index: gui/wxpython/gis_set.py
===================================================================
--- gui/wxpython/gis_set.py (revision 30949)
+++ gui/wxpython/gis_set.py (working copy)
@@ -558,7 +558,10 @@
self.lbmapsets.Clear()
self.lbmapsets.InsertItems(self.listOfMapsets, 0)
- self.lbmapsets.SetSelection(0)
+ try:
+ self.lbmapsets.SetSelection(0)
+ except:
+ pass
def OnSelectMapset(self,event):
"""Mapset selected"""
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user