The documentation I have seen on tkMessageBox
seems to indicate a boolean return for a user choice on an askyesnocancel
dialog. There are 3 options, so how can a boolean properly capture the user choice?
I've tried the approach shown below where a "yes" returns "True", "no" returns "False" and "cancel" returns "cancel", but that doesn't seem to work. A "no" or "cancel" selection both seem to be returned as "False". Anybody have any ideas on this?
if tkMessageBox.askyesnocancel("Error", "Choose yes, no or cancel", default='yes')
...
...
...
elif "cancel":
return
else:
pass