void note_save(UiObject *obj, NotebookModel *notebook, Note *note) {
NoteModel *m = note->model;
+ printf("title obj: %s\n", m->title->obj);
+
char *title = ui_get(m->title);
+ printf("title: %s\n", title);
char *content = ui_get(m->text);
const CxAllocator *a = notebook->current_notes_pool->allocator;
}
void notebookmodel_detach(NotebookModel *model) {
+ if(model->current_note && model->current_note->model->modified) {
+ note_save(model->window->obj, model, model->current_note);
+ }
+
if(model->window) {
ui_detach_document2(model->window->obj->ctx, model);
model->window->current_notebook = NULL;
}
-
- if(model->current_note && model->current_note->model->modified) {
- note_save(model->window->obj, model, model->current_note);
- }
}
void notebookmodel_set_collection(NotebookModel *model, Collection *collection) {