/* * Gem-graph OpenGL experiments * * Desc: User interface functions * * Copyright (C) 2023 Jean Sirmai * * This file is part of Gem-graph. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ #include #include #include #include "../../include/base.h" #include "../../include/ui.h" GtkListStore *list_store; /************************************************************* * * * Converting a GtkTreePath into a GtkTreeIter * * * *************************************************************/ /************************************************************* * * * onTreeViewRowActivated: a row has been double-clicked * * * *************************************************************/ void onTreeViewRowActivated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer userdata) { GtkTreeIter iter; GtkTreeModel *model; model = gtk_tree_view_get_model(view); if (gtk_tree_model_get_iter(model, &iter, path)) { gchar *name; gtk_tree_model_get(model, &iter, "ANY_COLUMN_NAME", &name, -1); g_print ("The row containing the name '%s' has been double-clicked.\n", name); g_free(name); } } void tree_c_printing_test(void) { list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_UINT); printf("tree_c_printing_test() \ ---------------------------------------------------------\n\n\ (https://en.wikibooks.org/wiki/GTK (modulo) 2B_By_Example/Tree_View/Tree_Models)\n\n\ cf. tuto : This creates a new list store with two columns.\n\ Column 0 stores a string and column 1 stores an unsigned integer for each row.\n\ At this point the model has no rows yet of course.\n"); }