def askYesNo(message, allow_cancel=False, title="Question"): """shows message and asks for "yes" or "no" (or "cancel" if allow_cancel is True). returns True, False (or None). """ app = guidata.qapplication() flags = QMessageBox.Yes | QMessageBox.No if allow_cancel: flags |= QMessageBox.Cancel reply = QMessageBox.question(None, title, message, flags) if reply == QMessageBox.Cancel: return None else: return reply == QMessageBox.Yes