Dialog box with exit?

How do you make a dialog box with an exit option? I’ve linked the example code. Specifically, I’m looking to make the “LoginDialog” form dialog box have an “exit” option similar to the “SignupDialog” form dialog box.

https://anvil.works/build#clone:TTLCYBO7UWVCSTWL%3DT37TCLU5COZYUZ2WONZ7RKXU

Look at the dismissible option in https://anvil.works/docs/client/python/alerts-and-notifications#custom-popup-styles

in the “login_flow” module, there is a dismissible option that is set to another variable. I changed it from:
choice = anvil.alert(d, title=“Log In”, dismissible=allow_cancel, buttons=BUTTONS)

to:
choice = anvil.alert(d, title=“Log In”, dismissible=True, buttons=BUTTONS)

Now the login popup does have an exit option, but whenever I hit the exit button, it keeps popping up over and over without closing the popup login… what am I missing here?

In that particular app, the alert is in a while loop:

  while anvil.users.get_user() is None:
    choice = anvil.alert(d, title="Log In", dismissible=True, buttons=BUTTONS)

Unless the user logs in with the alert, anvil.users.get_user() will be None, and so the loop will continue, and the alert will be continously re-created.

At the end of the loop, there is:

    elif choice is None and allow_cancel:
      break

So if you want to simply break out of the loop if the alert is dismissed, set allow_cancel=True.

That worked! Thank you!

Great! Feel free to mark correct solutions by checking the :white_check_mark: