I have been searching the forum for an answer to this question and although people seem to have asked this exact same question, it is in the context of specific function in their DialogInput
window or else I just don't understand the answer.
I am trying to use a CancelButton
in a DialogInput
window to cause all evaluations in my notebook to abort. Alternatively the kernel could quit. Either would be fine for my purpose. However, nothing I can do works. In the code I enter below, when the user hits the cancel button, the notebook just hangs.
I'm looking for a very general answer to how to just cause the kernel to quit when the user hits cancel in any DialogInput
window. Any help is greatly appreciated.
DialogInput[
Column[{"Select folder.",
FileNameSetter[Dynamic[d], "Directory"],
Row[{
DefaultButton[DialogReturn[SetDirectory[d]]],
CancelButton[DialogReturn[Abort[]]]
}]
}]
];
Abort[]
toQuit[]
work for you? $\endgroup$ – corey979 Dec 14 '16 at 23:04