]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Implement align_label_left for GTK 3.[14,16).
authorSimon Tatham <anakin@pobox.com>
Sun, 22 Nov 2015 21:47:21 +0000 (21:47 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 22 Nov 2015 23:10:11 +0000 (23:10 +0000)
gtk_misc_set_alignment was deprecated in GTK 3.14. But my replacement
code using gtk_label_set_xalign doesn't work there, because that
function wasn't introduced until GTK 3.16, so there are two minor
versions in the middle where a third strategy is needed.

unix/gtkmisc.c

index cbcc1af50ba8323c66bae5417593de76d24d31d5..d3619e2d358a1493104911c9691d59d34db96617 100644 (file)
@@ -62,6 +62,8 @@ void align_label_left(GtkLabel *label)
 {
 #if GTK_CHECK_VERSION(3,16,0)
     gtk_label_set_xalign(label, 0.0);
+#elif GTK_CHECK_VERSION(3,14,0)
+    gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
 #else
     gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
 #endif