[GRASS-SVN] r39923 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 6 15:25:22 EST 2009


Author: cmbarton
Date: 2009-12-06 15:25:22 -0500 (Sun, 06 Dec 2009)
New Revision: 39923

Modified:
   grass/trunk/gui/wxpython/gui_modules/help.py
Log:
Fix Mac use of menu tree window and double-clicking of item to run command. Backport from develbranch_6 r39922

Modified: grass/trunk/gui/wxpython/gui_modules/help.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/help.py	2009-12-06 20:20:01 UTC (rev 39922)
+++ grass/trunk/gui/wxpython/gui_modules/help.py	2009-12-06 20:25:22 UTC (rev 39923)
@@ -64,7 +64,8 @@
         wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
 
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
-        
+        self.dataBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
+                               label=" %s " % _("Menu tree (double-click to run command)"))        
         # tree
         self.tree = MenuTree(parent = self.panel, data = menudata.Data())
         self.tree.Load()
@@ -115,10 +116,10 @@
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         # body
-        dataBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
-                               label=" %s " % _("Menu tree (double-click to run command)"))
+#        dataBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
+#                               label=" %s " % _("Menu tree (double-click to run command)"))
         
-        dataSizer = wx.StaticBoxSizer(dataBox, wx.HORIZONTAL)
+        dataSizer = wx.StaticBoxSizer(self.dataBox, wx.HORIZONTAL)
         dataSizer.Add(item = self.tree, proportion =1,
                       flag = wx.EXPAND)
         
@@ -176,10 +177,14 @@
             return
 
         handler = 'self.parent.' + data['handler'].lstrip('self.')
-        if data['command']:
-            eval(handler)(event = None, cmd = data['command'].split())
+        print 'handler = '+data['handler']
+        if data['handler'] == 'self.OnXTerm':
+            wx.MessageBox('You must run this command from the menu or command line',
+                          'This command require an XTerm')
+        elif data['command']:
+            self.parent.goutput.RunCmd(data['command'], switchPage = True)
         else:
-            eval(handler)(None)
+            pass
         
         if self.closeOnRun.IsChecked():
             self.OnCloseWindow(None)



More information about the grass-commit mailing list