Jazz2::UI::Windows::MessageDialog struct

Shows a message with a choice of buttons.

Public static functions

static auto Show(Surface& surface, StringView title, StringView text, std::initializer_list<StringView> buttons, Function<void(std::int32_t)>&& callback) -> Dialog*
Shows a message, the callback gets the index of the button chosen.

Function documentation

static Dialog* Jazz2::UI::Windows::MessageDialog::Show(Surface& surface, StringView title, StringView text, std::initializer_list<StringView> buttons, Function<void(std::int32_t)>&& callback)

Shows a message, the callback gets the index of the button chosen.

It gets -1 if the message was closed by Escape or the cross instead — no button was chosen, so nothing should be done that can't be done later, nothing should be discarded.