3 void on_buttonAdd_clicked (GtkWidget
*treeview
, gpointer data
)
8 void add_entry(gchar
*txt
) {
9 /* ignore if entry is empty */
14 gtk_list_store_append(GTK_LIST_STORE(liststore
), &newrow
);
16 gtk_list_store_set(GTK_LIST_STORE(liststore
), &newrow
, COL_TEXT
, txt
, -1);
18 if (treevalid
== FALSE
) {
19 treevalid
= gtk_tree_model_get_iter_first(GTK_TREE_MODEL(liststore
), &mainIter
);
25 void remove_entry (GtkWidget
*treeview
, gpointer data
)
27 GtkTreeSelection
*sel
;
28 GtkTreeIter selected_row
;
30 sel
= gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview
));
32 if (gtk_tree_selection_get_selected(sel
, &liststore
, &selected_row
))
34 gtk_list_store_remove(GTK_LIST_STORE(liststore
), &selected_row
);
35 treevalid
= gtk_tree_model_get_iter_first(GTK_TREE_MODEL(liststore
), &mainIter
);
40 void on_treeview_edited (GtkCellRendererText
*celltext
,
41 const gchar
*string_path
, const gchar
*new_text
, gpointer data
) {
43 GtkTreeModel
*model
= GTK_TREE_MODEL(data
);
45 gtk_tree_model_get_iter_from_string(model
, &iter
, string_path
);
46 gtk_list_store_set(GTK_LIST_STORE(model
), &iter
, COL_TEXT
, new_text
, -1);
49 void on_buttonOpen_clicked(GtkWidget
*filechooser
, gpointer data
) {
50 /* Eerst vragen oude op te slaan ? */
52 fileOpen(gtk_file_chooser_get_filename(filechooser
));