aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-02-16 16:50:50 +0100
committerThomas White <taw@physics.org>2021-02-16 16:50:50 +0100
commit62c340b78fa1cf1430a9d1ec217f221406c05488 (patch)
treea496aaecd22583d7ffa3ef61abd2801a9d5b167c /src
parentd19fc43e9afd46e689d2169bb2320beec750d455 (diff)
Add set_active()
Diffstat (limited to 'src')
-rw-r--r--src/gtk-util-routines.c6
-rw-r--r--src/gtk-util-routines.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gtk-util-routines.c b/src/gtk-util-routines.c
index efdbc336..8fd9fecb 100644
--- a/src/gtk-util-routines.c
+++ b/src/gtk-util-routines.c
@@ -92,3 +92,9 @@ int i_maybe_disable(GtkWidget *toggle, GtkWidget *widget)
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle)));
return FALSE;
}
+
+
+void set_active(GtkWidget *tb, int active)
+{
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb), active);
+}
diff --git a/src/gtk-util-routines.h b/src/gtk-util-routines.h
index b2f91e7f..4fa782e9 100644
--- a/src/gtk-util-routines.h
+++ b/src/gtk-util-routines.h
@@ -36,5 +36,6 @@ extern int get_bool(GtkWidget *widget);
extern unsigned int get_uint(GtkWidget *entry);
extern float get_float(GtkWidget *entry);
extern int i_maybe_disable(GtkWidget *toggle, GtkWidget *widget);
+extern void set_active(GtkWidget *tb, int active);
#endif