[GRASS-dev] New installation for wxPython GUI

Moritz Lennert mlennert at club.worldonline.be
Wed Aug 9 08:11:13 EDT 2006


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.

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

--- 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