gtk+ r21607 - in trunk: . gtk



Author: cdywan
Date: Wed Oct  8 02:27:07 2008
New Revision: 21607
URL: http://svn.gnome.org/viewvc/gtk+?rev=21607&view=rev

Log:
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.

Modified:
   trunk/ChangeLog
   trunk/gtk/gtkmessagedialog.c

Modified: trunk/gtk/gtkmessagedialog.c
==============================================================================
--- trunk/gtk/gtkmessagedialog.c	(original)
+++ trunk/gtk/gtkmessagedialog.c	Wed Oct  8 02:27:07 2008
@@ -418,7 +418,7 @@
 				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 @@
   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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]