def update_var(self, name, value):
widget = self.widgets.get(name)<EOL>if widget is None:<EOL><INDENT>return False, '<STR_LIT>'.format(name)<EOL><DEDENT>try:<EOL><INDENT>if isinstance(widget, Gtk.CheckButton):<EOL><INDENT>widget.set_active(value)<EOL>return True, widget.get_active()<EOL><DEDENT>elif isinstance(widget, Gtk.Entry):<EOL><INDENT>widget.set_text(value)<EOL>return True, widget.get_text()<EOL><DEDENT>else:<EOL><INDENT>widget.set_value(value)<EOL>return True, widget.get_value()<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>return False, str(e)<EOL><DEDENT>
:return: success, err_msg_if_failed