ui/gtk/list.c

changeset 861
34b07b18b3e1
parent 860
7f2287ae2b78
child 862
670b2c03413f
equal deleted inserted replaced
860:7f2287ae2b78 861:34b07b18b3e1
2061 } 2061 }
2062 2062
2063 2063
2064 /* ------------------------------ Source List ------------------------------ */ 2064 /* ------------------------------ Source List ------------------------------ */
2065 2065
2066 static ui_sourcelist_update_func sourcelist_update_finished_callback;
2067
2068 void ui_sourcelist_set_update_callback(ui_sourcelist_update_func cb) {
2069 sourcelist_update_finished_callback = cb;
2070 }
2071
2072 static void ui_sourcelist_update_finished(void) {
2073 if(sourcelist_update_finished_callback) {
2074 sourcelist_update_finished_callback();
2075 }
2076 }
2077
2066 static void ui_destroy_sourcelist(GtkWidget *w, UiListBox *v) { 2078 static void ui_destroy_sourcelist(GtkWidget *w, UiListBox *v) {
2067 cxListFree(v->sublists); 2079 cxListFree(v->sublists);
2068 free(v); 2080 free(v);
2069 } 2081 }
2070 2082
2297 // reload sublist 2309 // reload sublist
2298 sublist->startpos = pos; 2310 sublist->startpos = pos;
2299 ui_listbox_update_sublist(listbox, sublist, pos); 2311 ui_listbox_update_sublist(listbox, sublist, pos);
2300 pos += sublist->numitems; 2312 pos += sublist->numitems;
2301 } 2313 }
2314
2315 ui_sourcelist_update_finished();
2302 } 2316 }
2303 2317
2304 static void listbox_button_clicked(GtkWidget *button, UiEventDataExt *data) { 2318 static void listbox_button_clicked(GtkWidget *button, UiEventDataExt *data) {
2305 UiListBoxSubList *sublist = data->customdata0; 2319 UiListBoxSubList *sublist = data->customdata0;
2306 2320
2621 pos += ls->numitems; 2635 pos += ls->numitems;
2622 } 2636 }
2623 } else { 2637 } else {
2624 update_sublist_item(sublist->listbox, sublist, i); 2638 update_sublist_item(sublist->listbox, sublist, i);
2625 } 2639 }
2640
2641 ui_sourcelist_update_finished();
2626 } 2642 }
2627 2643
2628 void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data) { 2644 void ui_listbox_row_activate(GtkListBox *self, GtkListBoxRow *row, gpointer user_data) {
2629 UiEventDataExt *data = g_object_get_data(G_OBJECT(row), "ui-listbox-row-eventdata"); 2645 UiEventDataExt *data = g_object_get_data(G_OBJECT(row), "ui-listbox-row-eventdata");
2630 if(!data) { 2646 if(!data) {

mercurial