22 lines
771 B
C++
22 lines
771 B
C++
//
|
|
// Created by selim on 14.05.2022.
|
|
//
|
|
|
|
#include "MessageDialog.h"
|
|
|
|
void gtkpp::MessageDialog::showError(gtkpp::Window *parent, const std::string &text) {
|
|
auto flags = static_cast<GtkDialogFlags>(GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL);
|
|
auto dialog = gtk_message_dialog_new(GTK_WINDOW(parent->gobj()),
|
|
flags,
|
|
GTK_MESSAGE_ERROR,
|
|
GTK_BUTTONS_CLOSE,
|
|
"%s",
|
|
text.c_str());
|
|
|
|
g_signal_connect (dialog, "response",
|
|
G_CALLBACK (gtk_window_destroy),
|
|
nullptr);
|
|
|
|
gtk_window_present(GTK_WINDOW(dialog));
|
|
}
|