summaryrefslogtreecommitdiff
path: root/extra/config/lxdialog/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'extra/config/lxdialog/util.c')
-rw-r--r--extra/config/lxdialog/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/extra/config/lxdialog/util.c b/extra/config/lxdialog/util.c
index e7bce9be6..6f83951b9 100644
--- a/extra/config/lxdialog/util.c
+++ b/extra/config/lxdialog/util.c
@@ -357,3 +357,19 @@ first_alpha(const char *string, const char *exempt)
return 0;
}
+
+/*
+ * Get the first selected item in the dialog_list_item list.
+ */
+struct dialog_list_item *
+first_sel_item(int item_no, struct dialog_list_item ** items)
+{
+ int i;
+
+ for (i = 0; i < item_no; i++) {
+ if (items[i]->selected)
+ return items[i];
+ }
+
+ return NULL;
+}