The following returns the user's choice among four items on a radio button bar, but it can also give a null return if they hit "OK" without selecting an option. How to avoid this? How to grey out the "OK" button (or there may be another way to achieve the same result) until a selection has been made?
a = DialogInput[{choice = {}},
Column[{RadioButtonBar[
Dynamic[choice], {"One ", "Two ", "Three", "Four"}],
Button["OK", DialogReturn[choice]]}]];
a = DialogInput[{choice = {}}, Column[{RadioButtonBar[Dynamic[choice], {"One ", "Two ", "Three", "Four"}], Button["OK", If[Not[choice === {}], DialogReturn[choice]]]}]]– Bob Hanlon Oct 01 '23 at 20:05Clear[a]; While[Not[StringQ[a]], a = DialogInput[{choice = {}}, Column[{RadioButtonBar[Dynamic[choice], {"One", "Two", "Three", "Four"}], Button["OK", If[choice =!= {}, DialogReturn[choice]]]}]]]– Bob Hanlon Oct 02 '23 at 02:27