aboutsummaryrefslogtreecommitdiffstats
path: root/callbacks-gtk.h
blob: 017a8c0ae3b734d91a6e7a6599b27def59ce6569 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#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(w)->active;		\
	update_screen();				\
	if (entry)					\
		gtk_widget_set_sensitive(*entry, option);\
}