[gtk+/gtk-3-20] label: don't use set_text in gtk_label_new



commit efcfa0ec94108281944cf26dc6cbdba08ac92dfc
Author: Timm Bäder <mail baedert org>
Date:   Tue May 3 19:26:02 2016 -0400

    label: don't use set_text in gtk_label_new
    
    It would just set up lots of things with the default values, but a
    common case is that a few gtk_label_set_* calls follow.

 gtk/gtklabel.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 6cb5331..08e8eb7 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1365,7 +1365,7 @@ gtk_label_init (GtkLabel *label)
 
   priv->width_chars = -1;
   priv->max_width_chars = -1;
-  priv->label = NULL;
+  priv->label = g_strdup ("");
   priv->lines = -1;
 
   priv->xalign = 0.5;
@@ -1391,8 +1391,6 @@ gtk_label_init (GtkLabel *label)
 
   priv->mnemonics_visible = TRUE;
 
-  gtk_label_set_text (label, "");
-
   priv->gadget = gtk_css_custom_gadget_new_for_node (gtk_widget_get_css_node (GTK_WIDGET (label)),
                                                      GTK_WIDGET (label),
                                                      gtk_label_measure,


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