Author: bugman Date: Sat Aug 6 21:09:41 2011 New Revision: 14216 URL: http://svn.gna.org/viewcvs/relax?rev=14216&view=rev Log: The spectrum list GUI element can also now be enabled/disabled via Enable(). Modified: branches/gui_testing/gui/components/spectrum.py Modified: branches/gui_testing/gui/components/spectrum.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/components/spectrum.py?rev=14216&r1=14215&r2=14216&view=diff ============================================================================== --- branches/gui_testing/gui/components/spectrum.py (original) +++ branches/gui_testing/gui/components/spectrum.py Sat Aug 6 21:09:41 2011 @@ -107,6 +107,17 @@ status.observers.gui_uf.register(self.name, self.build_element) + def Enable(self, enable=True): + """Enable or disable the element. + + @keyword enable: The flag specifying if the element should be enabled or disabled. + @type enable: bool + """ + + # Call the button's method. + self.button_add.Enable(enable) + + def add_buttons(self, sizer): """Add the buttons for peak list manipulation. @@ -119,13 +130,13 @@ sizer.Add(button_sizer, 0, wx.ALL|wx.EXPAND, 0) # Add button. - button = wx.lib.buttons.ThemedGenBitmapTextButton(self.panel, -1, None, " Add") - button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.add, wx.BITMAP_TYPE_ANY)) - button.SetFont(font.normal) - button.SetSize((80, self.height_buttons)) - button_sizer.Add(button, 0, 0, 0) - self.gui.Bind(wx.EVT_BUTTON, self.fn_add, button) - button.SetToolTipString("Read a spectral data file.") + self.button_add = wx.lib.buttons.ThemedGenBitmapTextButton(self.panel, -1, None, " Add") + self.button_add.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.add, wx.BITMAP_TYPE_ANY)) + self.button_add.SetFont(font.normal) + self.button_add.SetSize((80, self.height_buttons)) + button_sizer.Add(self.button_add, 0, 0, 0) + self.gui.Bind(wx.EVT_BUTTON, self.fn_add, self.button_add) + self.button_add.SetToolTipString("Read a spectral data file.") def build_element(self):