aboutsummaryrefslogtreecommitdiffstats
path: root/src/gwin/list.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2013-10-23 00:18:03 +0200
committerJoel Bodenmann <joel@unormal.org>2013-10-23 00:18:03 +0200
commit2e64bddee588c4a3ee7ba89e7257b8828b399cc4 (patch)
treef2b96e93ed849485598c39d43ae6d6a7f74d7a1e /src/gwin/list.c
parent4401d335a517196ea634dcc309d56130a594c621 (diff)
downloaduGFX-2e64bddee588c4a3ee7ba89e7257b8828b399cc4.tar.gz
uGFX-2e64bddee588c4a3ee7ba89e7257b8828b399cc4.tar.bz2
uGFX-2e64bddee588c4a3ee7ba89e7257b8828b399cc4.zip
Added gwinListGetSelectedText()
Diffstat (limited to 'src/gwin/list.c')
-rw-r--r--src/gwin/list.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gwin/list.c b/src/gwin/list.c
index 5407cb36..cf0bebc4 100644
--- a/src/gwin/list.c
+++ b/src/gwin/list.c
@@ -536,6 +536,18 @@ int gwinListItemCount(GHandle gh) {
return gh2obj->cnt;
}
+const char* gwinListGetSelectedText(GHandle gh) {
+ // is it a valid handle?
+ if (gh->vmt != (gwinVMT *)&listVMT)
+ return 0;
+
+ // return NULL if nothing is selected (or multi-select)
+ if (gwinListGetSelected(gh) < 0)
+ return 0;
+
+ return gwinListItemGetText(gh, gwinListGetSelected(gh));
+}
+
#if GWIN_NEED_LIST_IMAGES
void gwinListItemSetImage(GHandle gh, int item, gdispImage *pimg) {
const gfxQueueASyncItem * qi;