[GRASSGUI] Re: fix for select control?
michael.barton at asu.edu
Tue Apr 10 10:36:34 EDT 2007
I'm betting that I'll need to add item selected bindings to the selection
tree too. It's weird that it's working for vectors and not rasters, though.
The code in menuform.py is exactly the same.
On 4/10/07 5:56 AM, "Jachym Cepicky" <jachym.cepicky at gmail.com> wrote:
> I tested it and it seems to be working for vector modules only, not for
> When I try to add second (raster) layer, I get:
> Traceback (most recent call last):
> line 492, in addRaster
> line 544, in SetTree
> self.maptree.AddLayer(disp_idx, layertype)
> line 160, in AddLayer
> if (self.layer_selected and self.layer_selected != self.GetRootItem() and
> line 4996, in __ne__
> return _controls_.TreeItemId___ne__(*args, **kwargs)
> TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
> 'wxTreeItemId const *'
> 2007/4/10, Jachym Cepicky <jachym.cepicky at gmail.com>:
>> ok, thanks for it, I'll look at it
>> 2007/4/10, Michael Barton <michael.barton at asu.edu>:
>>> I sort of understand what is happening to cause the bug you encountered
>>> with the select.Select control. When the mapset group item in the selection
>>> tree is expanded, it generates a wx.EVT_TREE_ITEM_EXPANDING event. This gets
>>> propagated up through the hierarchy or controls to the grandparent object,
>>> the GIS Manager layer tree, where it is handled by the
>>> wx.EVT_TREE_ITEM_EXPANDING handler method onExpandNode.
>>> There may be a way to limit event propagation up the hierarchy that I don't
>>> understand, but what I've done is added an explicit binding for this event
>>> (and the wx.EVT_TREE_ITEM_COLLAPSED event too) in the selection tree class.
>>> This calls a dummy handler in that class. Hopefully, this will keep the item
>>> expand event in the class where it belongs. If we can fix this, it may be
>>> possible to put the selection tree inside a different kind of widget if that
>>> is desirable. Please uncomment line #131 in select and try it out. Let me
>>> know what happens.
>>> Michael Barton, Professor of Anthropology
>>> School of Human Evolution & Social Change
>>> Center for Social Dynamics & Complexity
>>> Arizona State University
>>> phone: 480-965-6213
>>> fax: 480-965-7671
>>> www: http://www.public.asu.edu/~cmbarton
>> Jachym Cepicky
>> e-mail: jachym.cepicky gmail com
>> URL: http://les-ejk.cz
>> GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
More information about the grass-gui