From ea56ff65a2dd18ca6344c004c3aa10cc4985e821 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 22 Feb 2002 02:22:26 +0000 Subject: gtk_widget_show() the icon_pixmap if the specified icon is not NULL. * e-combo-button.c (set_icon): gtk_widget_show() the icon_pixmap if the specified icon is not NULL. svn path=/trunk/; revision=15788 --- widgets/misc/e-combo-button.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'widgets/misc/e-combo-button.c') diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index c037586fc6..e6634b5c86 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -133,11 +133,22 @@ set_icon (EComboButton *combo_button, priv = combo_button->priv; + if (priv->icon != NULL) + gdk_pixbuf_unref (priv->icon); + + if (pixbuf == NULL) { + priv->icon = NULL; + gtk_widget_hide (priv->icon_pixmap); + return; + } + priv->icon = gdk_pixbuf_ref (pixbuf); gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &mask, 128); gtk_pixmap_set (GTK_PIXMAP (priv->icon_pixmap), pixmap, mask); + gtk_widget_show (priv->icon_pixmap); + gdk_pixmap_unref (pixmap); gdk_pixmap_unref (mask); } @@ -407,7 +418,6 @@ e_combo_button_set_icon (EComboButton *combo_button, { g_return_if_fail (combo_button != NULL); g_return_if_fail (E_IS_COMBO_BUTTON (combo_button)); - g_return_if_fail (pixbuf != NULL); set_icon (combo_button, pixbuf); } -- cgit v1.2.3