Gtk::MessageDialog Run throws a segmentation fault
Hi I'm trying to show an error mesaage using a dialogbox. However when I run the code I get segm开发者_如何学Pythonentation fault.
Here's the function:
void ShowErrorMessage(string message)
{
Gtk::MessageDialog dialog(message,true,Gtk::MESSAGE_ERROR,Gtk::BUTTONS_CLOSE,true);
dialog.run();
}
I try to open a file, if the file can not be open I wanna show this error box, however i keep running into segmentation fault.
Do you have to call new
on the dialog or is that a static class? See here for the document on this, which is leading me to think that's why your code segfaults...
Hope this helps, Best regards, Tom.
maybe you did not added this line at the begining?
Gtk::Main_kit(argc, argv);
精彩评论