def set_checked(self, val, do_callback=True):
        """ Internal method to check/uncheck the checkbox """
        self._node["isChecked"] = val

        if val:
            self._node["image"] = self._node["checkedImage"]
        else:
            self._node["image"] = self._node["uncheckedImage"]

        if do_callback and self._callback is not None:
            self._callback(*([val] + self._extra_args))
 Internal method to check/uncheck the checkbox 
metadrive/render_pipeline/rpcore/gui/checkbox.py