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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 24 07:32:57 EST 2008


Author: martinl
Date: 2008-02-24 07:32:57 -0500 (Sun, 24 Feb 2008)
New Revision: 30322

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: fix dialog tooltips (do not crash when tooltips are missing)

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-02-24 11:16:04 UTC (rev 30321)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-02-24 12:32:57 UTC (rev 30322)
@@ -1015,7 +1015,7 @@
                         selection.SetValue(p['value']) # parameter previously set
 
                     which_sizer.Add(item=selection, proportion=0,
-                                    flag=wx.ADJUST_MINSIZE| wx.BOTTOM | wx.LEFT, border=5)
+                                    flag=wx.ADJUST_MINSIZE| wx.BOTTOM | wx.LEFT | wx.RIGHT, border=5)
                     # A select.Select is a combobox with two children: a textctl and a popupwindow;
                     # we target the textctl here
                     p['wxId'] = selection.GetChildren()[0].GetId()
@@ -1083,8 +1083,9 @@
                         tooltip += 2 * os.linesep
                     else:
                         tooltip = ''
-                    for i in range(len(p['values'])):
-                        tooltip += p['values'][i] + ': ' + p['values_desc'][i] + os.linesep
+                    if len(p['values']) == len(p['values_desc']):
+                        for i in range(len(p['values'])):
+                            tooltip += p['values'][i] + ': ' + p['values_desc'][i] + os.linesep
                     tooltip.strip(os.linesep)
                 if tooltip:
                     txt.SetToolTipString(tooltip)



More information about the grass-commit mailing list