[GRASS-dev] New installation for wxPython GUI

Michael Barton michael.barton at asu.edu
Wed Aug 9 14:31:45 EDT 2006


Moritz, et al.

See below.

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: Wed, 09 Aug 2006 14:11:13 +0200
> To: Moritz Lennert <mlennert at club.worldonline.be>
> Cc: Michael Barton <michael.barton at asu.edu>, Trevor Wiens
> <twiens at interbaun.com>, David Finlayson <david.p.finlayson at gmail.com>, Jachym
> Cepicky <jachym.cepicky at centrum.cz>, Yann Chemin <ychemin at gmail.com>, Grass
> Developers List <grass-dev at grass.itc.it>
> Subject: Re: [GRASS-dev] New installation for wxPython GUI
> 
> Moritz Lennert wrote:
>> Michael,
>> 
>> Michael Barton wrote:
>>> I figured out how to run gism.py from outside the directory where it
>>> lives.
>>> So now we can run it from a script on the GRASS command line without
>>> changing directories.
>> 
>> great !
>> 
>> A few issues (using python 2.4.3 and wxpython 2.6.3.3 - installed on
>> Debian from rpms using alien - so there might be some problems with that
>> - I'll compile from source when I find the time):
>> 
>> - the display does not automatically redraw when I drag another window
>> over it. I have to click the display map button.
> 
> Adding a simple self.ReDraw(event=None) at the end of def onFocus(self,
> event) in mapdisp.py at least displays the map automatically when I
> refocus on the map display.
> 

This may be fixed. But if not don't use ReDraw. This causes GRASS to
completely re-render the map. Try one of the following:

add a...
self.mapPanel.Refresh()
...instead of a ReDraw call to onFocus

If this doesn't work,  add...
img = self.getImg()
self.draw(img)
...This will redraw the existing image without causing GRASS to re-render
it.


>> 
>> - I still have the panning problem. What it seems to be is that the
>> program does not release the mouse, so even if the mouse is outside the
>> window it still continues to pan. The only solution still is to switch
>> to another workspace and back. Then the map is gone, but the mouse is
>> usable again.
> 
> Actually, the fact that the map is gone is the same problem as the
> previous. So whenever the map display is not visible (beneath another
> window or on another workspace) and then becomes visible again, it is
> empty. The little ReDraw hack above allows to get it back just through
> focus, but that's not much different from clicking on display map.
> 
> 
>> 
>> - When I launch a command I get the correct command window, but any
>> subsequent command launched will give me the same window (i.e.
>> containing the options of the first command launched) except for the
>> title which correctly indicates the name of the command launched. Seems
>> like there needs to be some reinitialisation done.
>> 
>> - Are the add raster and add vector buttons already supposed to do
>> anything else then add to the list in the layers tab ?
>> 
>> - It would be great if the console could react to 'Enter', except having
>> to take up the mouse again and click run.
> 
> Here's a small hack to do this. As the command window is not defined as
> multiline, I don't think that Enter has any other usage.

Applied the patch below, though I used the new event binding syntax

self.Bind(wx.EVT_TEXT_ENTER, self.RunCmd, self.console_command)

I don't understand why this worked OK on my Mac WITHOUT this patch.
Thanks!

Michael

> 
> --- gism.py     2006-08-09 00:38:38.000000000 +0200
> +++ ../../py_gm_new/gmwxp/gism.py       2006-08-09 14:08:15.000000000 +0200
> @@ -56,7 +56,8 @@
> 
>           self.notebook_1_pane_2 = wx.Panel(self.notebook_1, -1,
> style=wx.FULL_REPAINT_ON_RESIZE)
>           self.console_output = wx.TextCtrl(self.notebook_1_pane_3, -1,
> "", style=wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)
> -        self.console_command = wx.TextCtrl(self.notebook_1_pane_3, -1,
> "", style=wx.HSCROLL|wx.TE_LINEWRAP)
> +        self.console_command = wx.TextCtrl(self.notebook_1_pane_3, -1,
> "", style=wx.HSCROLL|wx.TE_LINEWRAP|wx.TE_PROCESS_ENTER)
> +       wx.EVT_TEXT_ENTER ( self.notebook_1_pane_3, -1, self.RunCmd )
>           self.console_run = wx.Button(self.notebook_1_pane_3, -1, _("Run"))
>           self.console_clear = wx.Button(self.notebook_1_pane_3, -1,
> _("Clear"))
>           self.console_save = wx.Button(self.notebook_1_pane_3, -1,
> _("Save"))
> 
> 
> Moritz




More information about the grass-dev mailing list