diff options
| author | Simon Tatham <anakin@pobox.com> | 2015-10-04 19:30:08 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2015-10-04 19:33:44 +0100 |
| commit | 2afbcdcc3c6d59aa03280df65ce6c690baa4273f (patch) | |
| tree | c398f2f667e25f9b1c22a2aba0f6ee8496f70a20 | |
| parent | 5e22080bcd581fe4e2a07ca897ebea19a2961f66 (diff) | |
| download | puzzles-2afbcdcc3c6d59aa03280df65ce6c690baa4273f.zip puzzles-2afbcdcc3c6d59aa03280df65ce6c690baa4273f.tar.gz puzzles-2afbcdcc3c6d59aa03280df65ce6c690baa4273f.tar.bz2 puzzles-2afbcdcc3c6d59aa03280df65ce6c690baa4273f.tar.xz | |
GTK 3.16 deprecation: stop using gtk_misc_set_alignment.
The new equivalent is gtk_label_set_{x,y}align. But we can't use that
in all GTK 3 builds, because it's very new.
| -rw-r--r-- | gtk.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -1401,6 +1401,16 @@ static int win_key_press(GtkWidget *widget, GdkEventKey *event, gpointer data) enum { MB_OK, MB_YESNO }; +static void align_label(GtkLabel *label, double x, double y) +{ +#if GTK_CHECK_VERSION(3,16,0) + gtk_label_set_xalign(label, x); + gtk_label_set_yalign(label, y); +#else + gtk_misc_set_alignment(GTK_MISC(label), x, y); +#endif +} + int message_box(GtkWidget *parent, char *title, char *msg, int centre, int type) { @@ -1410,7 +1420,7 @@ int message_box(GtkWidget *parent, char *title, char *msg, int centre, window = gtk_dialog_new(); text = gtk_label_new(msg); - gtk_misc_set_alignment(GTK_MISC(text), 0.0, 0.0); + align_label(GTK_LABEL(text), 0.0, 0.0); hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), text, FALSE, FALSE, 20); gtk_box_pack_start @@ -1594,7 +1604,7 @@ static int get_config(frontend *fe, int which) */ w = gtk_label_new(i->name); - gtk_misc_set_alignment(GTK_MISC(w), 0.0, 0.5); + align_label(GTK_LABEL(w), 0.0, 0.5); #if GTK_CHECK_VERSION(3,0,0) gtk_grid_attach(GTK_GRID(table), w, 0, y, 1, 1); #else @@ -1650,7 +1660,7 @@ static int get_config(frontend *fe, int which) */ w = gtk_label_new(i->name); - gtk_misc_set_alignment(GTK_MISC(w), 0.0, 0.5); + align_label(GTK_LABEL(w), 0.0, 0.5); #if GTK_CHECK_VERSION(3,0,0) gtk_grid_attach(GTK_GRID(table), w, 0, y, 1, 1); #else |