diff options
author | Joel Bodenmann <joel@unormal.org> | 2013-10-23 00:18:03 +0200 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-10-23 17:28:04 +1000 |
commit | 6cc80926f00ce8d6533298cbb5ea061c1446287b (patch) | |
tree | 8b70c0e71af851b8f889eac1cd6499f804a09225 /src/gwin/list.c | |
parent | 5f17570ebcba8998757cdcb2df0a92a6215b7448 (diff) | |
download | uGFX-6cc80926f00ce8d6533298cbb5ea061c1446287b.tar.gz uGFX-6cc80926f00ce8d6533298cbb5ea061c1446287b.tar.bz2 uGFX-6cc80926f00ce8d6533298cbb5ea061c1446287b.zip |
Added gwinListGetSelectedText()
Diffstat (limited to 'src/gwin/list.c')
-rw-r--r-- | src/gwin/list.c | 12 |
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; |