1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/messagedialog.h>
4 #include <gtkmm/private/messagedialog_p.h>
6 #include <gtk/gtktypebuiltins.h>
12 * Copyright 2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <gtk/gtkmessagedialog.h>
30 #include <gtk/gtklabel.h>
36 MessageDialog::MessageDialog(const Glib::ustring& message, bool use_markup,
37 MessageType type, ButtonsType buttons,
40 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
41 Gtk::Dialog(Glib::ConstructParams(messagedialog_class_.init(), "message_type",(GtkMessageType)type,"buttons",(GtkButtonsType)buttons, (char*) 0))
44 set_message(message, use_markup);
47 MessageDialog::MessageDialog(Gtk::Window& parent, const Glib::ustring& message, bool use_markup,
48 MessageType type, ButtonsType buttons,
51 Glib::ObjectBase(0), //Mark this class as gtkmmproc-generated, rather than a custom class, to allow vfunc optimisations.
52 Gtk::Dialog(Glib::ConstructParams(messagedialog_class_.init(), "message_type",(GtkMessageType)type,"buttons",(GtkButtonsType)buttons, (char*) 0))
55 set_transient_for(parent);
56 set_message(message, use_markup);
59 void MessageDialog::set_message(const Glib::ustring& message, bool use_markup)
61 // TODO: GTK+ bug: The label widget is really a <private> struct field.
62 // There should really be a message property.
65 gtk_message_dialog_set_markup(gobj(), message.c_str());
67 gtk_label_set_text(GTK_LABEL(gobj()->label), message.c_str());
70 void MessageDialog::set_secondary_text(const Glib::ustring& text, bool use_markup)
73 gtk_message_dialog_format_secondary_markup(gobj(), text.c_str());
75 gtk_message_dialog_format_secondary_text(gobj(), text.c_str());
83 } // anonymous namespace
86 GType Glib::Value<Gtk::MessageType>::value_type()
88 return gtk_message_type_get_type();
92 GType Glib::Value<Gtk::ButtonsType>::value_type()
94 return gtk_buttons_type_get_type();
101 Gtk::MessageDialog* wrap(GtkMessageDialog* object, bool take_copy)
103 return dynamic_cast<Gtk::MessageDialog *> (Glib::wrap_auto ((GObject*)(object), take_copy));
106 } /* namespace Glib */
112 /* The *_Class implementation: */
114 const Glib::Class& MessageDialog_Class::init()
116 if(!gtype_) // create the GType if necessary
118 // Glib::Class has to know the class init function to clone custom types.
119 class_init_func_ = &MessageDialog_Class::class_init_function;
121 // This is actually just optimized away, apparently with no harm.
122 // Make sure that the parent type has been created.
123 //CppClassParent::CppObjectType::get_type();
125 // Create the wrapper type, with the same class/instance size as the base type.
126 register_derived_type(gtk_message_dialog_get_type());
128 // Add derived versions of interfaces, if the C type implements any interfaces:
134 void MessageDialog_Class::class_init_function(void* g_class, void* class_data)
136 BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
137 CppClassParent::class_init_function(klass, class_data);
142 Glib::ObjectBase* MessageDialog_Class::wrap_new(GObject* o)
144 return new MessageDialog((GtkMessageDialog*)(o)); //top-level windows can not be manage()ed.
149 /* The implementation: */
151 MessageDialog::MessageDialog(const Glib::ConstructParams& construct_params)
153 Gtk::Dialog(construct_params)
157 MessageDialog::MessageDialog(GtkMessageDialog* castitem)
159 Gtk::Dialog((GtkDialog*)(castitem))
163 MessageDialog::~MessageDialog()
168 MessageDialog::CppClassType MessageDialog::messagedialog_class_; // initialize static member
170 GType MessageDialog::get_type()
172 return messagedialog_class_.init().get_type();
175 GType MessageDialog::get_base_type()
177 return gtk_message_dialog_get_type();
181 void MessageDialog::set_markup(const Glib::ustring& str)
183 gtk_message_dialog_set_markup(gobj(), str.c_str());