mailr12026 - /branches/bieri_gui/gui_bieri/user_functions/base.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on December 29, 2010 - 17:10:
Author: bugman
Date: Wed Dec 29 17:10:39 2010
New Revision: 12026

URL: http://svn.gna.org/viewcvs/relax?rev=12026&view=rev
Log:
Tooltips are now shown for the input field widget for the user function 
windows.


Modified:
    branches/bieri_gui/gui_bieri/user_functions/base.py

Modified: branches/bieri_gui/gui_bieri/user_functions/base.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bieri_gui/gui_bieri/user_functions/base.py?rev=12026&r1=12025&r2=12026&view=diff
==============================================================================
--- branches/bieri_gui/gui_bieri/user_functions/base.py (original)
+++ branches/bieri_gui/gui_bieri/user_functions/base.py Wed Dec 29 17:10:39 
2010
@@ -477,15 +477,17 @@
         return field
 
 
-    def input_field(self, sizer, desc):
+    def input_field(self, sizer, desc, tooltip=None):
         """Build the input field.
 
-        @param sizer:   The sizer to put the input field into.
-        @type sizer:    wx.Sizer instance
-        @param desc:    The text description.
-        @type desc:     str
-        @return:        The input field object.
-        @rtype:         wx.TextCtrl instance
+        @param sizer:       The sizer to put the input field into.
+        @type sizer:        wx.Sizer instance
+        @param desc:        The text description.
+        @type desc:         str
+        @keyword tooltip:   The tooltip which appears on hovering over the 
text or input field.
+        @type tooltip:      str
+        @return:            The input field object.
+        @rtype:             wx.TextCtrl instance
         """
 
         # Init.
@@ -507,6 +509,11 @@
         # Add to the main sizer (followed by stretchable spacing).
         sizer.Add(field_sizer)
         sizer.AddStretchSpacer()
+
+        # Tooltip.
+        if tooltip:
+            text.SetToolTipString(tooltip)
+            field.SetToolTipString(tooltip)
 
         # Return the object.
         return field




Related Messages


Powered by MHonArc, Updated Thu Dec 30 10:20:03 2010