From: Miroslav Lichvar Date: Wed, 9 Jul 2008 13:03:02 +0000 (+0200) Subject: before checkboxtree drawing return first item in GetCurrent() X-Git-Tag: r0-52-10~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a6201337ecb52ba56f7d763ef48622c7d1ba8fd;p=thirdparty%2Fnewt.git before checkboxtree drawing return first item in GetCurrent() --- diff --git a/checkboxtree.c b/checkboxtree.c index 418ae18..7bd9de3 100644 --- a/checkboxtree.c +++ b/checkboxtree.c @@ -717,7 +717,12 @@ struct eventResult ctEvent(newtComponent co, struct event ev) { const void * newtCheckboxTreeGetCurrent(newtComponent co) { struct CheckboxTree * ct = co->data; - if (!ct->currItem) return NULL; + if (!ct->currItem) + if (ct->itemlist) + return ct->itemlist->data; + else + return NULL; + return (*ct->currItem)->data; }