virtual bool
error(const std::string &err)
{
- Gtk::Dialog dialog(
- "Error", // Title
- true, // Modal
- true // use_separator
- );
- Gtk::Label label(err);
- label.show();
-
- dialog.get_vbox()->pack_start(label);
- dialog.add_button(Gtk::StockID("gtk-ok"),RESPONSE_OK);
+ Gtk::MessageDialog dialog(err, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true);
dialog.show();
dialog.run();
return true;
void
App::dialog_error_blocking(const std::string &title, const std::string &message)
{
- Gtk::Dialog dialog(
- title, // Title
- true, // Modal
- true // use_separator
- );
- Gtk::Label label(message);
- label.show();
-
- dialog.get_vbox()->pack_start(label);
- dialog.add_button(Gtk::StockID("gtk-ok"),1);
+ Gtk::MessageDialog dialog(message, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true);
+ dialog.set_title(title);
dialog.show();
dialog.run();
}
void
App::dialog_warning_blocking(const std::string &title, const std::string &message)
{
- Gtk::Dialog dialog(
- title, // Title
- true, // Modal
- true // use_separator
- );
- Gtk::Label label(message);
- label.show();
-
- dialog.get_vbox()->pack_start(label);
- dialog.add_button(Gtk::StockID("gtk-ok"),1);
+ Gtk::MessageDialog dialog(message, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true);
+ dialog.set_title(title);
dialog.show();
dialog.run();
}
#include <gtkmm/paned.h>
#include <gtkmm/scale.h>
#include <gtkmm/dialog.h>
+#include <gtkmm/messagedialog.h>
#include <gtkmm/treemodelsort.h>
#include <gtkmm/buttonbox.h>
// then just go ahead and return false --
// don't bother displaying a dialog
if(view->cancel)return false;
-
- Gtk::Dialog dialog(
- "Error", // Title
- *view, // Parent
- true, // Modal
- true // use_separator
- );
- Gtk::Label label(err);
- label.show();
-
- dialog.get_vbox()->pack_start(label);
- dialog.add_button(Gtk::StockID("gtk-ok"),RESPONSE_OK);
+ Gtk::MessageDialog dialog(*view, err, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true);
dialog.show();
dialog.run();
view->statusbar->pop();