WIP: Changement de cap : mettre un label dans la GtkBox *runlib_objects; de windows.c

This commit is contained in:
Jean Sirmai 2023-11-25 22:26:34 +01:00
parent fdc87782c6
commit d3a64462db
Signed by: jean
GPG Key ID: FB3115C340E057E3
3 changed files with 42 additions and 48 deletions

View File

@ -32,26 +32,11 @@
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();
g_autoptr(GemGraphClientApplication) app = NULL; g_autoptr(GemGraphClientApplication) app = NULL;
int res; int res;
// bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
// bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
// textdomain (GETTEXT_PACKAGE);
app = gem_graph_client_application_new("org.alec.gemgraph", app = gem_graph_client_application_new("org.alec.gemgraph",
G_APPLICATION_DEFAULT_FLAGS); G_APPLICATION_DEFAULT_FLAGS);

View File

@ -73,6 +73,27 @@
</child> </child>
<child> <child>
<object class="GtkStack" id="runlib_stack"> <object class="GtkStack" id="runlib_stack">
<child>
<object class="GtkStackPage">
<property name="name">runlib_objects</property>
<property name="title" translatable="yes">Objects</property>
<property name="visible">True</property>
<property name="child">
<object class="GtkBox" id="runlib_objects">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label_runlib_objects">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;Here must be a label (then a tree)&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="margin-top">50</property>
<property name="margin-bottom">50</property>
</object>
</child>
</object>
</property>
</object>
</child>
<child> <child>
<object class="GtkStackPage"> <object class="GtkStackPage">
<property name="name">runlib_conditions_and_rules</property> <property name="name">runlib_conditions_and_rules</property>
@ -89,27 +110,6 @@
</property> </property>
</object> </object>
</child> </child>
<child>
<object class="GtkStackPage">
<property name="name">runlib_objects</property>
<property name="title" translatable="yes">Objects</property>
<property name="visible">True</property>
<property name="child">
<object class="GtkBox" id="runlib_objects">
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel" id="label_runlib_objects">
<property name="justify">center</property>
<property name="label" translatable="yes">&lt;b&gt;runlib_objects&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="margin-top">50</property>
<property name="margin-bottom">50</property>
</object>
</child>
</object>
</property>
</object>
</child>
<child> <child>
<object class="GtkStackPage"> <object class="GtkStackPage">
<property name="name">runlib_states</property> <property name="name">runlib_states</property>

View File

@ -176,22 +176,16 @@ tree_c_test(void)
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\
(https://en.wikibooks.org/wiki/GTK (modulo) 2B_By_Example/Tree_View/Columns_and_Renderer)\n\ Changement de cap : comment mettre un label (puis un arbre)\n\
Trying to adapt the first example of this tuto to display a simple tree view in our window.\n\ dans la GtkBox *runlib_objects; de windows.c (ligne 61)\n\
Can't use :\n\ ?\n\
- gtk_init(&argc, &argv);\n\
- window = gtk_tree_view_new(GTK_WINDOW_TOPLEVEL);\n\
- g_signal_connect(window, 'delete_event', gtk_main_quit, NULL);\n\
- tree_c_test(); (or : create_view_and_model() or some equivalent tree description)\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://en.wikibooks.org/wiki/GTK%2B_By_Example/Tree_View/Tree_Models
// https://stackoverflow.com/questions/74556059/how-to-build-a-tree-in-gtk4-4-10
//
/* /*
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
@ -328,3 +322,18 @@ public class SharpApp : Window
} }
*/ */
/*
(https://en.wikibooks.org/wiki/GTK%2B_By_Example/Tree_View/Columns_and_Renderer)\n\
Trying to adapt the first example of this tuto to display a simple tree view in our window.\n\
Can't use :\n\
- gtk_init(&argc, &argv);\n\
- window = gtk_tree_view_new(GTK_WINDOW_TOPLEVEL);\n\
- g_signal_connect(window, 'delete_event', gtk_main_quit, NULL);\n\
- tree_c_test(); (or : create_view_and_model() or some equivalent tree description)\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\
*/