align_label_left.c 507 B

123456789101112131415161718192021
  1. /*
  2. * Helper function to align the text in a GtkLabel to the left, which
  3. * has to be done in several different ways depending on GTK version.
  4. */
  5. #include <gtk/gtk.h>
  6. #include "putty.h"
  7. #include "gtkcompat.h"
  8. #include "gtkmisc.h"
  9. void align_label_left(GtkLabel *label)
  10. {
  11. #if GTK_CHECK_VERSION(3,16,0)
  12. gtk_label_set_xalign(label, 0.0);
  13. #elif GTK_CHECK_VERSION(3,14,0)
  14. gtk_widget_set_halign(GTK_WIDGET(label), GTK_ALIGN_START);
  15. #else
  16. gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
  17. #endif
  18. }