File: align_label_left.c

package info (click to toggle)
putty 0.78-2%2Bdeb12u2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,964 kB
  • sloc: ansic: 137,777; python: 7,775; perl: 1,798; makefile: 133; sh: 111
file content (20 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
 * Helper function to align the text in a GtkLabel to the left, which
 * has to be done in several different ways depending on GTK version.
 */

#include <gtk/gtk.h>
#include "putty.h"
#include "gtkcompat.h"
#include "gtkmisc.h"

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
}