Author: bugman Date: Tue Jul 19 13:31:10 2011 New Revision: 13725 URL: http://svn.gna.org/viewcvs/relax?rev=13725&view=rev Log: The add_spin_element() analysis base class method now handles tooltips. Modified: branches/gui_testing/gui/analyses/base.py Modified: branches/gui_testing/gui/analyses/base.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/analyses/base.py?rev=13725&r1=13724&r2=13725&view=diff ============================================================================== --- branches/gui_testing/gui/analyses/base.py (original) +++ branches/gui_testing/gui/analyses/base.py Tue Jul 19 13:31:10 2011 @@ -148,7 +148,7 @@ return field - def add_spin_element(self, box, parent, text="", default=0, min=0, max=1000, control=wx.SpinCtrl): + def add_spin_element(self, box, parent, text="", default=0, min=0, max=1000, tooltip=None, control=wx.SpinCtrl): """Create a text selection element using a spinner for the frame. This consists of a horizontal layout with a static text element and a spin control @@ -165,6 +165,8 @@ @type min: int @keyword max: The maximum value allowed. @type max: int + @keyword tooltip: The tooltip which appears on hovering over the text or spin control. + @type tooltip: str @keyword control: The control class to use. @type control: wx.SpinCtrl derived class @return: The text control object. @@ -195,6 +197,11 @@ # Add the element to the box. box.Add(sizer, 0, wx.ALL|wx.EXPAND, 0) + + # Tooltip. + if tooltip: + label.SetToolTipString(tooltip) + field.SetToolTipString(tooltip) # Return the text control object. return field