aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-05-11 10:54:07 +0200
committerThomas White <taw@physics.org>2021-05-11 10:54:07 +0200
commitdc1689e674b1b48c73cee2b2957e42f766d8dbf0 (patch)
treedb898b49ce13c85e6a38e0bf5f0005909996fc1d /src
parente693445ac62fdd54eacf56b8436f55fa579cc50f (diff)
Add set_combo_id()
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 4117dfda..4e622060 100644
--- a/src/gtk-util-routines.c
+++ b/src/gtk-util-routines.c
@@ -129,6 +129,12 @@ void set_active(GtkWidget *tb, int active)
}
+void set_combo_id(GtkWidget *cb, const char *id)
+{
+ gtk_combo_box_set_active_id(GTK_COMBO_BOX(cb), id);
+}
+
+
void redraw_widget(GtkWidget *wid)
{
gint w, h;
diff --git a/src/gtk-util-routines.h b/src/gtk-util-routines.h
index e378a49f..5486155d 100644
--- a/src/gtk-util-routines.h
+++ b/src/gtk-util-routines.h
@@ -39,6 +39,7 @@ extern int i_maybe_disable(GtkWidget *toggle, GtkWidget *widget);
extern int i_maybe_disable_and_deselect(GtkWidget *toggle, GtkWidget *widget);
extern void deselect_when_active(GtkWidget *toggle, GtkWidget *widget);
extern void set_active(GtkWidget *tb, int active);
+extern void set_combo_id(GtkWidget *cb, const char *id);
extern void redraw_widget(GtkWidget *wid);
extern const char *get_text_or_null(GtkEntry *entry);