Creating a Yes/No dialog?

I am trying to create dialogs looking something like these (from another piece of software)

After much searching the best I can come up with is this:

CreateDialog[
Grid[{
{"Would you like to look for a text file containing dissociation constants?","    "},
{Item[ChoiceButtons[{"Yes","No"}, {DialogReturn["Yes"]; DialogReturn["No"]}],Alignment -> Right],SpanFromLeft}}, Alignment -> Left]]

which shows as

My only problem is in determining which button has been pressed because DialogReturn[“Yes”] doesn’t work.

I never guessed it would be so difficult to get a simple Yes/No dialog!

Maybe ChoiceDialog?

ChoiceDialog[
  "Would you like to look for a text file containing dissociation constants?", 
  {"Yes, abolutely!" -> True, "I'd rather not" -> False}]

And if you would be satisfied with the standard “OK” and “Cancel” buttons, you could get away with just this:

ChoiceDialog["Would you like to look for a text file containing dissociation constants?"]

I believe I looked at ChoiceDialog but could not make it modal - if it can be made modal that would certainly be the way to go.

ChoiceDialog[
“Would you like to look for a text file containing dissociation constants?”,
{“Yes, abolutely!” → True, “I’d rather not” → False},
Modal → True]

Thank you, Eric. My only excuse is that on this page
ChoiceDialog there is no mention of Modal whatsoever. I admit that there is probably something somewhere in the docs about using Modal with dialogs in general, but it is not immediately obvious.

My other gripe would be that, in order to make “No” the default option, you would have to swap the positions of the buttons (unless I am mistaken about that too).

Regarding swapping the buttons, if I understand what you mean, yes, I think think the first button that you specify is the default button. But there may be an option for that.

Which brings us to your other comment. In the documentation, it is standard to find info about the options in the “Details and Options” section. Some options will be explained explicitly, and for others you may be referred to the docs for a different function. I am very surprised that ChoiceDialog didn’t mention Modal. But once you’re comfortable with the docs and have an intuition for how functions are related to each other, you can sniff out things that maybe aren’t obvious. So, I saw that CreateDialog was a related function, and it sounds like it’s more general. ChoiceDialog probably “inherits” from it. Indeed, Modal is mentioned in the documentation for CreateDialog.

And then there’s the Options function. You can use it to see all the options for a function along with their default values. So, try Options[ChoiceDialog]. Unfortunately, this is something else a bit different for ChoiceDialog: its options list is huge (and maybe that’s why options are explicitly discussed in the docs for ChoiceDialog). The reason is because all of these dialog generating functions are really generating whole notebooks, and so you can pass notebook options through them. You can also just take a guess and ask for a specific option: Options[ChoiceDialog, Modal].

You might find an option in there for controlling the default button. Or you might spend some time looking at the documentation for the various dialog functions and see if any of those pages shows a way to change the default. Or you might inspect the actual notebook that gets generated as the dialog and see what the underlying cells/expressions for the buttons look like.

I take all your points and I am gradually becoming more comfortable with the docs. I will definitely bear in mind the Options function.