34 class MessageBox final :
public ScopedMessageBoxInterface
37 explicit MessageBox (
const MessageBoxOptions& options)
38 : inner (detail::AlertWindowHelpers::create (options)),
39 numButtons (options.getNumButtons()) {}
43 inner->runAsync ([fn, n = numButtons] (
int result)
49 int runSync()
override
51 return map (inner->runSync(), numButtons);
60 static int map (
int button,
int numButtons) {
return (button + numButtons - 1) % numButtons; }