def activate(self, action, value): new_state = not action.get_state().unpack() action.set_state(GLib.Variant(self.type_name, new_state)) self.obj.set_property(self.property_name, new_state)