ui/gtk/list.c

changeset 658
b25f54b51d76
parent 657
02bcdbc34f31
child 659
d6baaa93f7be
equal deleted inserted replaced
657:02bcdbc34f31 658:b25f54b51d76
2006 2006
2007 size_t index = 0; 2007 size_t index = 0;
2008 void *elm = list->first(list); 2008 void *elm = list->first(list);
2009 while(elm) { 2009 while(elm) {
2010 UiSubListItem item = { NULL, NULL, NULL, NULL, NULL, NULL }; 2010 UiSubListItem item = { NULL, NULL, NULL, NULL, NULL, NULL };
2011 listbox->getvalue(list, sublist->userdata, elm, index, &item, listbox->getvaluedata); 2011 if(listbox->getvalue) {
2012 listbox->getvalue(list, sublist->userdata, elm, index, &item, listbox->getvaluedata);
2013 } else {
2014 item.label = strdup(elm);
2015 }
2012 2016
2013 // create listbox item 2017 // create listbox item
2014 GtkWidget *row = create_listbox_row(listbox, sublist, &item, (int)index); 2018 GtkWidget *row = create_listbox_row(listbox, sublist, &item, (int)index);
2015 if(index == 0) { 2019 if(index == 0) {
2016 // first row in the sublist, set ui_listbox data to the row 2020 // first row in the sublist, set ui_listbox data to the row

mercurial