aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-07-14 15:58:40 +0200
committerThomas White <taw@physics.org>2021-07-14 15:58:40 +0200
commit6fd02d7cefd6f6f61e623c26525a941c1e0b3e59 (patch)
treead625b31e837047e7405ec0ac0e4f66e19052f03 /src
parent6b98d433c6e461f5c351f8ed6dec84da21d45870 (diff)
Add get_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 4e622060..ca39d861 100644
--- a/src/gtk-util-routines.c
+++ b/src/gtk-util-routines.c
@@ -135,6 +135,12 @@ void set_combo_id(GtkWidget *cb, const char *id)
}
+const char *get_combo_id(GtkWidget *cb)
+{
+ return gtk_combo_box_get_active_id(GTK_COMBO_BOX(cb));
+}
+
+
void redraw_widget(GtkWidget *wid)
{
gint w, h;
diff --git a/src/gtk-util-routines.h b/src/gtk-util-routines.h
index 5486155d..417200b8 100644
--- a/src/gtk-util-routines.h
+++ b/src/gtk-util-routines.h
@@ -40,6 +40,7 @@ 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 const char *get_combo_id(GtkWidget *cb);
extern void redraw_widget(GtkWidget *wid);
extern const char *get_text_or_null(GtkEntry *entry);