y++;
}
}
-
- //gtk_widget_size_allocate(view->items[0].image, &child_allocation, -1);
// draw children
GtkWidgetClass *cls = mz_files_view_parent_class;
printf("mz_update_files_view\n");
// TODO: free previous files
+ mz_files_view_remove_items(view);
free(view->items);
gtk_widget_queue_draw(GTK_WIDGET(view));
}
+
+void mz_files_view_remove_items(MzFilesView *view) {
+ for(size_t i=0;i<view->numitems;i++) {
+ gtk_widget_unparent(view->items[i].image);
+ gtk_widget_unparent(view->items[i].label);
+ }
+}