forked from speed-dreams/speed-dreams-code
Added GfuiScrollListClear function
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@2585 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 8cb2273438676af76c60e54b73c977960422409b Former-commit-id: 5f90f15484b628ab7b4aafbe3218d2b80a475f33
This commit is contained in:
parent
f9f84b9ee5
commit
813a1420d0
1 changed files with 26 additions and 2 deletions
|
@ -24,12 +24,13 @@
|
|||
@ingroup gui
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "tgfclient.h"
|
||||
#include "gui.h"
|
||||
#include "guifont.h"
|
||||
|
@ -463,6 +464,29 @@ GfuiScrollListExtractElement(void *scr, int Id, int index, void **userData)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
GfuiScrollListClear(void *scr, int id)
|
||||
{
|
||||
tGfuiObject *object;
|
||||
tGfuiScrollList *scrollist;
|
||||
tGfuiListElement *elt;
|
||||
|
||||
object = gfuiGetObject(scr, id);
|
||||
if (!object || object->widget != GFUI_SCROLLIST) {
|
||||
return;
|
||||
}
|
||||
|
||||
scrollist = &(object->u.scrollist);
|
||||
|
||||
while ((elt = gfuiScrollListRemElt(scrollist, 0))) {
|
||||
free(elt);
|
||||
}
|
||||
|
||||
scrollist->nbElts = 0;
|
||||
scrollist->selectedElt = -1;
|
||||
}
|
||||
|
||||
|
||||
/** Insert an element in a scroll list.
|
||||
@ingroup gui
|
||||
@param scr Current screen
|
||||
|
|
Loading…
Reference in a new issue