[GRASS-dev] New installation for wxPython GUI

Michael Barton michael.barton at asu.edu
Thu Aug 10 16:42:39 EDT 2006


This change in binding the paint event from the panel where the painting
goes on to the entire frame has bad effects on window resizing. It makes it
very choppy, unresponsive, and sometimes inaccurate.

Adding in the 3 lines to redraw the current image into the onFocus event is
also problematic. It causes the display to disappear (and sometimes
reappear) anytime you change focus.

I've uploaded a new version of mapdisp.py to try out (I'm a bit in the dark
because I only have sporadic access to a Debian machine).

I've added some event.Skip() lines to the event handlers. This will let them
continue to process other events while processing their own. So I'm hoping
it will help with the disappearing display when you pass another window over
it. I also added a pointer tool that is selected on startup. It doesn't do
anything at the moment--which means it doesn't accidentally zoom in so far
the screen blanks out. Finally, I changed the zoom factor for wheel zooming
to make it a bit smoother. I can make it even smoother yet (and slower, of
course) if you think that is better.

Michael 
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


> From: Moritz Lennert <mlennert at club.worldonline.be>
> Date: Thu, 10 Aug 2006 17:36:56 +0200
> Cc: Jachym Cepicky <jachym.cepicky at centrum.cz>, Michael Barton
> <michael.barton at asu.edu>, Grass Developers List <grass-dev at grass.itc.it>,
> Trevor Wiens <twiens at interbaun.com>, David Finlayson
> <david.p.finlayson at gmail.com>, Yann Chemin <ychemin at gmail.com>
> Subject: Re: [GRASS-dev] New installation for wxPython GUI
> 
> Moritz Lennert wrote:
>>>>> - the display does not automatically redraw when I drag another window
>>>>> over it. I have to click the display map button.
>>>> 
> 
> I found a solution to this: change line 49 in mapdisp.py from
> 
>          self.Bind(wx.EVT_PAINT, self.ReDraw, self.mapPanel)
> 
> to
> 
>          self.Bind(wx.EVT_PAINT, self.ReDraw)
> 
> 
> Now whenever the display was hidden and is made visible again, the image
> gets redrawn.
> 
> It still is a different behaviour from what I see "normally" since there
> is a short delay (~1sec) before the display is refreshed. Normally (with
> any other window, including the tcltk GIS manager) I don't see any
> refresh happening. It is as if the image never was erased. So I guess
> there must be another solution.
> 
> One option (in case you haven't already seen this, Michael) might be this:
> 
> http://wiki.wxpython.org/index.cgi/DoubleBufferedDrawing
> 
> for which a class is proposed here:
> 
> http://wiki.wxpython.org/index.cgi/BufferedCanvas
> 
> 
> A completely different question: Michael, are you planning on continuing
> with the raster drawing system via the ppm files, or should the wxpython
>   manager actually display vector drawings when displaying vector maps ?
> 
> Moritz




More information about the grass-dev mailing list