GNOME Bugzilla – Bug 736489
gtk_widget_set_halign does not work for labels with line wrap
Last modified: 2014-09-18 10:59:13 UTC
This code creates a label that is line-wrapped and left-aligned: char *long_string = "..."; GtkWidget *label = gtk_label_new (long_string); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_max_width_chars (GTK_LABEL (label), 40); gtk_widget_show (label); This works fine, but GtkMisc is deprecated, so I want to replace the call to gtk_misc_set_alignment with gtk_widget_set_halign, the documented replacement: gtk_widget_set_halign (label, GTK_ALIGN_START); But this doesn't work. The label widget's allocation is left-aligned, but the text inside the label is shifted towards the center.
keep using xalign. it has been undeprecated