[GRASS-dev] switch active window on Map Display

Wenzeslaus wenzeslaus at gmail.com
Mon Aug 8 17:00:09 EDT 2011


Hi Madi and list,

parent of window created from Layer Manager (your case) is Layer
Manager (the class GMFrame from wxgui.py). It contains references to
all Map Display Windows. You can get Map Display related to current
notebook page by:
self.parent.curr_page.maptree.mapdisplay

So you probably want to write this:
self.parent.curr_page.maptree.mapdisplay.Raise()

(I suppose that in __init__ you have: self.parent = parent)



I have general note to this. Maybe it is common problem that someone
want to get current Map Display. So some simple getter function should
be introduced:

class GMFrame(wx.Frame):
    # ...
    def GetCurrentMapDisplay():
       """!Returns current Map Display window"""
       return self.parent.curr_page.maptree.mapdisplay



Vasek




On 8 August 2011 16:23, Margherita Di Leo <dileomargherita at gmail.com> wrote:
> Hi Devs,
>
> within my GSoC project [0] I'm working on the preview function in wxpython,
> that allows the user to select a point on canvas and to see the preview of
> the hydrological simulation over a small region of which the selected point
> is the center. So I have to get the position of the point from Map Display.
> My issue is that I have to switch from r.stream GUI to Map Display as the
> active panel. I also am looking at [1] but profile.py does not have this
> problem, because its parent frame is map display itself, so it doesn't have
> to switch on canvas. So I am looking for suggestions on how to do that.
>
> Thanks in advance,
>
> madi
>
>
> [0] http://grass.osgeo.org/wiki/Wx.stream_gsoc2011
> [1]
> http://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/gui_modules/profile.py
>
> --
> Eng. Margherita Di Leo
> Ph.D. Candidate
> Methods and Technologies for Environmental Monitoring
> Department of Environmental Engineering and Physics (DIFA)
>
> University of Basilicata
> Campus Macchia Romana
> 85100 - Potenza
> Italy
>
> Office: +39-0971205360
>
>
>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>


More information about the grass-dev mailing list