Nana C++ Library An open-source C++ framework project The Programmer's Guide |
||||||||||||||||||||||||||||||
nana::gui::msgbox Description The class msgbox is used for displaying a modal dialog box to prompt a brief message that inform and instruct the user. Model of None Public base classes None Typedefs
Members
File nana/gui/wvl.hpp Examples The following code example shows how to use class msgbox to inform the user. int main() { using namespace nana::gui; form fm; fm.make_event<events::unload>( msgbox(fmx, STR("Form closing")).icon(msgbox::icon_information)<<STR("The form is closing now") ); fm.show(); exec(); } The following code example shows how to ask user yes or no question and make a decision based on the respone. void when_exit(const nana::gui::eventinfo& ei) { using namespace nana::gui; msgbox mb(ei.window, STR("Nana C++ Library"), msgbox::yes_no); mb.icon(mb.icon_question); ei.unload.cancel = (mb.show() != msgbox::pick_yes); } int main() { using namespace nana::gui; form fm; fm.make_event<events::unload>(when_exit); fm.show(); exec(); } Notes 1, The msgbox::operator() is equal to msgbox::show(). See also None. Move to The Nana Programmer's Guide Main Page |
||||||||||||||||||||||||||||||