Closing a Gtk::MessageDialog
- From: John Emmas <john creativepost co uk>
- To: gtkmm <gtkmm-list gnome org>
- Subject: Closing a Gtk::MessageDialog
- Date: Fri, 17 Mar 2017 17:57:26 +0000
Suppose I'm writing an app whose purpose is just to test if something
exists and display an appropriate message box:-
#include <gtkmm.h>
int main (int argc, char *argv[])
{
Gtk::Main app ( &argc, &argv );
Glib::ustring message;
if ( the_thing_exists () )
message = "Yes, it existed";
else
message = "No, it didn't exist";
Gtk::MessageDialog mainWnd (message, false,
Gtk::MESSAGE_INFO, Gtk::BUTTONS_CLOSE);
app.run (mainWnd);
return 0;
}
The above code does display a MessageDialog (with the correct text) but
its CLOSE button doesn't close the dialog. I've tried other buttons (OK
/ CANCEL etc) but none of them seems to close the dialog (which I
assumed would be the default action). What am I missing here..?
John
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]