2 /* $Id: messagedialog.ccg,v 1.7 2005/02/15 10:52:44 murrayc Exp $ */
6 * Copyright 2002 The gtkmm Development Team
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <gtk/gtkmessagedialog.h>
24 #include <gtk/gtklabel.h>
30 MessageDialog::MessageDialog(const Glib::ustring& message, bool use_markup,
31 MessageType type, ButtonsType buttons,
34 _CONSTRUCT("message_type", (GtkMessageType)type, "buttons", (GtkButtonsType)buttons)
37 set_message(message, use_markup);
40 MessageDialog::MessageDialog(Gtk::Window& parent, const Glib::ustring& message, bool use_markup,
41 MessageType type, ButtonsType buttons,
44 _CONSTRUCT("message_type", (GtkMessageType)type, "buttons", (GtkButtonsType)buttons)
47 set_transient_for(parent);
48 set_message(message, use_markup);
51 void MessageDialog::set_message(const Glib::ustring& message, bool use_markup)
53 // TODO: GTK+ bug: The label widget is really a <private> struct field.
54 // There should really be a message property.
57 gtk_message_dialog_set_markup(gobj(), message.c_str());
59 gtk_label_set_text(GTK_LABEL(gobj()->label), message.c_str());
62 void MessageDialog::set_secondary_text(const Glib::ustring& text, bool use_markup)
65 gtk_message_dialog_format_secondary_markup(gobj(), text.c_str());
67 gtk_message_dialog_format_secondary_text(gobj(), text.c_str());