ui/gtk/list.c

changeset 591
637de2359995
parent 580
9b8d61227169
child 593
7061c9cf3b52
equal deleted inserted replaced
589:4d86050ad6ff 591:637de2359995
1808 if(var) { 1808 if(var) {
1809 UiList *list = var->value; 1809 UiList *list = var->value;
1810 list->obj = uilistbox; 1810 list->obj = uilistbox;
1811 list->update = ui_listbox_dynamic_update; 1811 list->update = ui_listbox_dynamic_update;
1812 1812
1813 ui_listbox_dynamic_update(list, 0); 1813 ui_listbox_dynamic_update(list, -1);
1814 } 1814 }
1815 } 1815 }
1816 1816
1817 // register uilistbox for both widgets, so it doesn't matter which 1817 // register uilistbox for both widgets, so it doesn't matter which
1818 // widget is used later 1818 // widget is used later
1841 UiListBox *uilistbox = list->obj; 1841 UiListBox *uilistbox = list->obj;
1842 1842
1843 // unbind/free previous list vars 1843 // unbind/free previous list vars
1844 CxIterator i = cxListIterator(uilistbox->sublists); 1844 CxIterator i = cxListIterator(uilistbox->sublists);
1845 cx_foreach(UiListBoxSubList *, s, i) { 1845 cx_foreach(UiListBoxSubList *, s, i) {
1846 // TODO: "unbind/free previous list vars" will also remove
1847 // the widget list. This makes the widget optimization
1848 // in ui_listbox_update_sublist pointless
1849 // Is it actually possible to not recreate the whole list?
1850 CxIterator r = cxListIterator(s->widgets);
1851 cx_foreach(GtkWidget*, widget, r) {
1852 LISTBOX_REMOVE(uilistbox->listbox, widget);
1853 }
1854
1846 if(s->var) { 1855 if(s->var) {
1847 UiList *sl = s->var->value; 1856 UiList *sl = s->var->value;
1848 sl->obj = NULL; 1857 sl->obj = NULL;
1849 sl->update = NULL; 1858 sl->update = NULL;
1850 if(s->var->type == UI_VAR_SPECIAL) { 1859 if(s->var->type == UI_VAR_SPECIAL) {

mercurial