]> Pileus Git - ~andy/gtk/commitdiff
bail out if there is no label to set the color on.
authorMichael Natterer <mitch@imendio.com>
Tue, 12 Aug 2008 15:47:13 +0000 (15:47 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Tue, 12 Aug 2008 15:47:13 +0000 (15:47 +0000)
2008-08-12  Michael Natterer  <mitch@imendio.com>

* gtk/gtklinkbutton.c (set_link_color): bail out if there is no
label to set the color on.

(gtk_link_button_add): call set_link_color() so the label gets
the right color no matter how the link button is created.

svn path=/trunk/; revision=21100

ChangeLog
gtk/gtklinkbutton.c

index 992aa7b9e42c4f267e1bcace1508770a88a7221b..8d87436342bbb63e528f632a8e26f170238f7d8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-12  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtklinkbutton.c (set_link_color): bail out if there is no
+       label to set the color on.
+
+       (gtk_link_button_add): call set_link_color() so the label gets
+       the right color no matter how the link button is created.
+
 2008-08-12  Michael Natterer  <mitch@imendio.com>
 
        * gtk/gtkassistant.c: remove unused variable and fix formatting of
index 843a6888fd1b5776cff9550510f55f1a8b637cce..9a6d134e996d61331092a90601f9a747d230c1fe 100644 (file)
@@ -250,6 +250,8 @@ set_link_color (GtkLinkButton *link_button)
   GtkWidget *label;
 
   label = gtk_bin_get_child (GTK_BIN (link_button));
+  if (!GTK_IS_LABEL (label))
+    return;
 
   if (link_button->priv->visited)
     {
@@ -303,6 +305,7 @@ gtk_link_button_add (GtkContainer *container,
 {
   GTK_CONTAINER_CLASS (gtk_link_button_parent_class)->add (container, widget);
 
+  set_link_color (GTK_LINK_BUTTON (container));
   set_link_underline (GTK_LINK_BUTTON (container));
 }