Change the availability of some options in FamilyLines depending on the value of other options.

svn: r9945
This commit is contained in:
Brian Matherly
2008-01-28 13:25:22 +00:00
parent f37918ad3a
commit a25fb9bdd6
3 changed files with 68 additions and 41 deletions

View File

@ -225,12 +225,22 @@ class GuiNumberOption(gtk.SpinButton):
self.connect('value_changed', self.__value_changed)
tooltip.set_tip(self, self.__option.get_help())
self.__option.connect('avail-changed', self.__update_avail)
self.__update_avail()
def __value_changed(self, obj): # IGNORE:W0613 - obj is unused
"""
Handle the change of the value.
"""
vtype = type(self.__option.get_value())
self.__option.set_value( vtype(self.get_value()) )
def __update_avail(self):
"""
Update the availability (sensitivity) of this widget.
"""
avail = self.__option.get_available()
self.set_sensitive(avail)
#-------------------------------------------------------------------------
#