mailr13228 - /branches/gui_testing/gui/analyses/base.py


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

Header


Content

Posted by edward on June 27, 2011 - 12:40:
Author: bugman
Date: Mon Jun 27 12:40:30 2011
New Revision: 13228

URL: http://svn.gna.org/viewcvs/relax?rev=13228&view=rev
Log:
The execute relax buttons now each have a unique ID which is returned by 
add_execute_relax().


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=13228&r1=13227&r2=13228&view=diff
==============================================================================
--- branches/gui_testing/gui/analyses/base.py (original)
+++ branches/gui_testing/gui/analyses/base.py Mon Jun 27 12:40:30 2011
@@ -81,19 +81,27 @@
         @type box:      wx.BoxSizer instance
         @param method:  The method to execute when the button is clicked.
         @type method:   method
+        @return:        The unique ID of the button.
+        @rtype:         int
         """
 
         # A horizontal sizer for the contents.
         sizer = wx.BoxSizer(wx.HORIZONTAL)
 
+        # A unique ID.
+        id = wx.NewId()
+
         # The button.
-        button = buttons.ThemedGenBitmapTextButton(self.parent, -1, None, " 
Execute relax")
+        button = buttons.ThemedGenBitmapTextButton(self.parent, id, None, " 
Execute relax")
         button.SetBitmapLabel(wx.Bitmap(paths.IMAGE_PATH+'relax_start.gif', 
wx.BITMAP_TYPE_ANY))
         self.gui.Bind(wx.EVT_BUTTON, method, button)
         sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0)
 
         # Add the element to the box.
         box.Add(sizer, 0, wx.ALIGN_RIGHT, 0)
+
+        # Return the ID.
+        return id
 
 
     def add_spin_control(self, box, parent, text='', min=None, max=None, 
control=wx.SpinCtrl, width=-1, height=-1):




Related Messages


Powered by MHonArc, Updated Mon Jun 27 13:00:02 2011