WIP: Trying to copy the first example of the tuto (this commit lists what I'm unable to adapt)
This commit is contained in:
parent
1f96af32fd
commit
fdc87782c6
10
src/main.c
10
src/main.c
|
@ -32,6 +32,16 @@
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
GtkWidget *window;
|
||||||
|
GtkWidget *view;
|
||||||
|
gtk_init();
|
||||||
|
// window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
|
||||||
|
// g_signal_connect(window, "delete_event", gtk_main_quit, NULL); /* dirty */
|
||||||
|
g_signal_connect(window, "delete_event", NULL, NULL); /* dirty */
|
||||||
|
// view = create_view_and_model();
|
||||||
|
// gtk_container_add(GTK_CONTAINER(window), view);
|
||||||
|
// gtk_widget_show_all(window);
|
||||||
|
// gtk_main();
|
||||||
|
|
||||||
tree_c_test();
|
tree_c_test();
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,8 @@ static void gem_graph_client_application_class_init(
|
||||||
app_class->activate = gem_graph_client_application_activate;
|
app_class->activate = gem_graph_client_application_activate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GemGraphClientApplication *gem_graph_client_application_new(
|
GemGraphClientApplication *gem_graph_client_application_new(
|
||||||
const char *application_id,
|
const char *application_id,
|
||||||
GApplicationFlags flags)
|
GApplicationFlags flags)
|
||||||
|
|
|
@ -162,23 +162,37 @@ tree_c_test(void)
|
||||||
}
|
}
|
||||||
else g_error("Oops, we should have a first row in the tree store!\n");
|
else g_error("Oops, we should have a first row in the tree store!\n");
|
||||||
|
|
||||||
|
GtkTreeViewColumn *col;
|
||||||
|
GtkCellRenderer *renderer;
|
||||||
|
GtkWidget *view;
|
||||||
|
GtkTreeModel *model;
|
||||||
|
|
||||||
|
GtkWidget *window;
|
||||||
|
|
||||||
|
|
||||||
tree_c_printing_test();
|
tree_c_printing_test();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tree_c_printing_test(void)
|
static void tree_c_printing_test(void)
|
||||||
{
|
{
|
||||||
printf("tree_c_printing_test() \
|
printf("tree_c_printing_test() \
|
||||||
---------------------------------------------------------\n\n\
|
------------------------------------------------------------------\n\
|
||||||
(https://en.wikibooks.org/wiki/GTK (modulo) 2B_By_Example/Tree_View/Tree_Models)\n\
|
(https://en.wikibooks.org/wiki/GTK (modulo) 2B_By_Example/Tree_View/Columns_and_Renderer)\n\
|
||||||
(https://en.wikibooks.org/wiki/GTK (modulo) 2B_By_Example/Tree_View/Columns_and_Renderer)\n\n\
|
Trying to adapt the first example of this tuto to display a simple tree view in our window.\n\
|
||||||
cf. tuto : gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_UINT); - (cf. line 69)\n\
|
Can't use :\n\
|
||||||
creates a new list store with two columns.\n\n\
|
- gtk_init(&argc, &argv);\n\
|
||||||
gtk_tree_store_new(1, G_TYPE_STRING); - (cf. line 108)\n\
|
- window = gtk_tree_view_new(GTK_WINDOW_TOPLEVEL);\n\
|
||||||
creates a new tree store with one column.\n\n\
|
- g_signal_connect(window, 'delete_event', gtk_main_quit, NULL);\n\
|
||||||
Now : how to display in our window (/panel) what was stored in these models ?.\n\
|
- tree_c_test(); (or : create_view_and_model() or some equivalent tree description)\n\
|
||||||
(see the commented code at the end)\n");
|
- gtk_container_add(GTK_CONTAINER(window), view);\n\
|
||||||
|
- gtk_widget_show_all(window);\n\
|
||||||
|
- gtk_main();\n\
|
||||||
|
(see main.c lines 35-44)\n\
|
||||||
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://en.wikibooks.org/wiki/GTK%2B_By_Example/Tree_View/Tree_Models
|
||||||
|
|
||||||
/*
|
/*
|
||||||
https://stackoverflow.com/questions/51002454/how-to-list-all-the-rows-of-a-gtk-treeview
|
https://stackoverflow.com/questions/51002454/how-to-list-all-the-rows-of-a-gtk-treeview
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue