mirror of
https://git.planet-casio.com/Lephenixnoir/JustUI.git
synced 2024-12-29 13:03:40 +01:00
jlist: autofill info structure to 0 before calling info function
This avoids having to specify all fields in the info function.
This commit is contained in:
parent
ba7b0a02d0
commit
12b29f8223
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <gint/display.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Type identifier for jlist */
|
||||
static int jlist_type_id = -1;
|
||||
|
@ -126,6 +127,7 @@ void jlist_update_model(jlist *l, int item_count)
|
|||
|
||||
l->item_count = item_count;
|
||||
for(int i = 0; i < item_count; i++) {
|
||||
memset(&l->items[i], 0, sizeof l->items[i]);
|
||||
l->info_function(l, i, &l->items[i]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue