mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
41027c2843
This forces us to use the proper gtk accessor functions. It may not be worth it if people actually do the Qt conversion, but if we want to try gtk3 at some point, this might help. This all came about because I was trying to explain on G+ what an immense pain this all was to even figure out, if you don't actually know gtk at all. Google and the gtk migration guide are almost useless, and the gtk2 documentation itself actually uses the fields directly without any accessor functions in several places. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
17 lines
507 B
C
17 lines
507 B
C
#define UNITCALLBACK(name, type, value) \
|
|
static void name(GtkWidget *w, gpointer data) \
|
|
{ \
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) \
|
|
prefs.units.type = value; \
|
|
update_screen(); \
|
|
}
|
|
|
|
#define OPTIONCALLBACK(name, option) \
|
|
static void name(GtkWidget *w, gpointer data) \
|
|
{ \
|
|
GtkWidget **entry = data; \
|
|
option = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); \
|
|
update_screen(); \
|
|
if (entry) \
|
|
gtk_widget_set_sensitive(*entry, option);\
|
|
}
|