Example #1
0
 def get_options():
     options = get_attribute_by_name(owner, options_attr)
     if options is None:
         return ['']
     if options:
         option_strings = [to_string(o) for o in options]
         if empty_option:
             option_strings.insert(0, '')
         return option_strings
     else:
         return ['']
Example #2
0
 def _tk_variable_changed(*args):
     trait_value = get_attribute_by_name(owner, name)
     if trait_value is not None:
         trait_value = self.pack(trait_value)
     try:
         tk_variable_value = self.tk_variable.get()
     except ValueError:
         return
     if trait_value != tk_variable_value:
         set_attribute_by_name(
             owner, name, self.unpack(tk_variable_value)
         )
Example #3
0
 def _trait_changed():
     self.tk_variable.set(
         self.pack(get_attribute_by_name(owner, name))
     )
Example #4
0
 def _option_subattr_changed():
     options = get_options()
     replace_options(self.option_menu, options)
     self.tk_variable.set(
         self.pack(get_attribute_by_name(owner, select_attr))
     )