diff options
author | Christian Dywan <christian@imendio.com> | 2008-10-08 02:27:07 +0000 |
---|---|---|
committer | Christian Dywan <cdywan@src.gnome.org> | 2008-10-08 02:27:07 +0000 |
commit | 5d8adc940630cfdb9f347521817863bc75528b5f (patch) | |
tree | 6b8b9f179bf28376379415aab4adc857b21fabbb /gtk/gtkmessagedialog.c | |
parent | eda544e8e6ed4289d0063c53c1e0d19923dc1419 (diff) | |
download | gtk+-5d8adc940630cfdb9f347521817863bc75528b5f.tar.gz |
Bug 555270 – Allow unsetting a MessageDialog's image
2008-10-08 Christian Dywan <christian@imendio.com>
Bug 555270 – Allow unsetting a MessageDialog's image
* gtk/gtkmessagedialog.c (gtk_message_dialog_set_property),
Remove a superfluous cast to GtkWidget*
(gtk_message_dialog_set_image): Accept NULL for the image
and unset the image in that case.
svn path=/trunk/; revision=21607
Diffstat (limited to 'gtk/gtkmessagedialog.c')
-rw-r--r-- | gtk/gtkmessagedialog.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c index ca8356018b..ecae119220 100644 --- a/gtk/gtkmessagedialog.c +++ b/gtk/gtkmessagedialog.c @@ -418,7 +418,7 @@ gtk_message_dialog_set_property (GObject *object, g_value_get_boolean (value)); break; case PROP_IMAGE: - gtk_message_dialog_set_image (dialog, (GtkWidget *)g_value_get_object (value)); + gtk_message_dialog_set_image (dialog, g_value_get_object (value)); break; default: @@ -628,6 +628,13 @@ gtk_message_dialog_set_image (GtkMessageDialog *dialog, GtkWidget *parent; g_return_if_fail (GTK_IS_MESSAGE_DIALOG (dialog)); + g_return_if_fail (image == NULL || GTK_IS_WIDGET (image)); + + if (image == NULL) + { + image = gtk_image_new_from_stock (NULL, GTK_ICON_SIZE_DIALOG); + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); + } priv = GTK_MESSAGE_DIALOG_GET_PRIVATE (dialog); |