Blocks until the user clicks a button or closes the dialog with
the window manager's close decoration (or by pressing Escape).
You need to set up the dialog to do the right thing when a button
is clicked or delete_event is received; you must consider both of
those possibilities so that you know the status of the dialog when
run() returns. A common mistake is to forget about Escape and the
window manager close decoration; by default, these call close(),
which by default destroys the dialog. If your button clicks do not
destroy the dialog, you don't know whether the dialog is destroyed
when run() returns. This is bad.
So you should either close the dialog on button clicks as well, or
change the close() behavior to hide instead of destroy. You can do
this with close_hides().