13
0

ArdourMessageDialog allow for NULL parent window

This is handy on Windows, where Widget::get_toplevel() may
return NULL or not-a Gtk::Window.
This commit is contained in:
Robin Gareus 2023-09-25 20:55:33 +02:00
parent 300de26b3e
commit ccef22f998
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 22 additions and 0 deletions

View File

@ -45,6 +45,21 @@ ArdourMessageDialog::ArdourMessageDialog (Gtk::Window& parent,
set_position (WIN_POS_MOUSE);
}
ArdourMessageDialog::ArdourMessageDialog (Gtk::Window* parent,
const Glib::ustring& message,
bool use_markup,
Gtk::MessageType type,
Gtk::ButtonsType buttons,
bool modal)
: Gtk::MessageDialog (message, use_markup, type, buttons, modal)
, _splash_pushed (false)
{
if (parent) {
set_transient_for (*parent);
}
set_position (WIN_POS_MOUSE);
}
ArdourMessageDialog::~ArdourMessageDialog ()
{
pop_splash ();

View File

@ -37,6 +37,13 @@ public:
Gtk::ButtonsType buttons = Gtk::BUTTONS_OK,
bool modal = false);
ArdourMessageDialog (Gtk::Window* parent,
const Glib::ustring& message,
bool use_markup = false,
Gtk::MessageType type = Gtk::MESSAGE_INFO,
Gtk::ButtonsType buttons = Gtk::BUTTONS_OK,
bool modal = false);
virtual ~ArdourMessageDialog ();
int run ();