How do I create a frontend dialog which blocks the kernel evaluation?

I am essentially trying to prevent ‘2’ from being printed, before I click the OK button:

Print[1];MessageDialog["hi"];Print[2];

Is there a simple way to achieve this?

Will go around with GoTo work for your case? If you type stop , then 2 will not be printed.

Module[{},
  Print[1];
  If[InputString[]=="stop",Goto[end]];
  Print[2];
  Label[end];]

Hi, this solves your problem:

Print[1];
DialogInput[DialogNotebook[{TextCell["Click to proceed"],Button["Proceed",DialogReturn[1]]}]];
Print[2];

Thanks!

I found this also later in the documentation … I was getting stuck on trying various things with MessageDialog.