npyscreen
npyscreen copied to clipboard
Form and ActionFormMinimal don't allow you to cancel closing the form
You can set an on_ok handler that cancels closing a form using an ActionForm, but it doesn't work with Form, ActionFormMinimal, and perhaps some others:
class MyForm(npyscreen.ActionFormMinimal):
def on_ok(self):
if npyscreen.notify_yes_no('Are you ready to submit your information?', title='Submit information?'):
pass
else:
self.editing = True
I think it's expected behavior that you can set self.editing = True on any form that has an OK and/or Cancel button, to help prevent closing the form accidentally.