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.
–
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
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@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.
--
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
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