[GRASS-SVN] r37439 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 24 14:03:14 EDT 2009


Author: martinl
Date: 2009-05-24 14:03:14 -0400 (Sun, 24 May 2009)
New Revision: 37439

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
Log:
wx.PopupWindow fix
	       (merge from trunk, r37437, r37438)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-05-24 18:01:38 UTC (rev 37438)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-05-24 18:03:14 UTC (rev 37439)
@@ -21,7 +21,6 @@
 
 import sys
 import shlex
-import platform
 
 import wx
 import wx.lib.mixins.listctrl as listmix
@@ -49,12 +48,14 @@
 
         ### todo: fix TextCtrlAutoComplete to work also on Macs
         ### reason: missing wx.PopupWindow()
-        if not platform.mac_ver()[0]:
+        try:
             cmdinput = TextCtrlAutoComplete(parent = cmdprompt, id = wx.ID_ANY,
                                             value = "",
                                             style = wx.TE_LINEWRAP | wx.TE_PROCESS_ENTER,
                                             size = (-1, 25))
-        else:
+        except NotImplementedError:
+            # wx.PopupWindow may be not available in wxMac
+            # see http://trac.wxwidgets.org/ticket/9377
             cmdinput = wx.TextCtrl(parent = cmdprompt, id = wx.ID_ANY,
                                    value = "",
                                    style=wx.TE_LINEWRAP | wx.TE_PROCESS_ENTER,
@@ -158,7 +159,11 @@
         self.itemDataMap = dict()
         
         # widgets
-        self.dropdown = wx.PopupWindow(self)
+        try:
+            self.dropdown = wx.PopupWindow(self)
+        except NotImplementedError:
+            self.Destroy()
+            raise NotImplementedError
         
         # create the list and bind the events
         self.dropdownlistbox = PromptListCtrl(parent = self.dropdown,



More information about the grass-commit mailing list