diff --git a/contain.h b/contain.h index 4c70ac0..2909d99 100644 --- a/contain.h +++ b/contain.h @@ -15,6 +15,7 @@ #define W_IMAGE_LOCAL W / 16 #define H_IMAGE_LOCAL H / 16 +GtkWidget *get_selected_rules_vpaned_new(); void activate (GtkApplication *app, gpointer user_data); diff --git a/hot.c b/hot.c index ad74525..b61ccc7 100644 --- a/hot.c +++ b/hot.c @@ -43,7 +43,7 @@ void on_tree_bind_factory (GtkSignalListItemFactory *factory, GObject* object, gpointer user_data) { - GObject *item; +// GObject *item; const gchar *text; GtkTreeListRow *row; GtkListItem *list_item; @@ -111,6 +111,7 @@ static void add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child) } // Recursive function to free a TreeNode and its children +// attention: « free_tree_node » défini mais pas utilisé <<< TODO static void free_tree_node (struct TreeNode_t *node) { struct TreeNode_t *cur; @@ -164,7 +165,7 @@ GListModel* ui_tree_create_model_func(GObject *item, gpointer root) struct TreeNode_t *cur = (struct TreeNode_t *)root; struct TreeNode_t *parent = NULL; - gchar *string = gtk_string_object_get_string(GTK_STRING_OBJECT(item)); + const gchar *string = gtk_string_object_get_string(GTK_STRING_OBJECT(item)); parent = root; while (cur) { @@ -222,7 +223,7 @@ static void ui_create_tree (GtkWidget *target_widget) gtk_string_list_append(model, tree_root->text); // Create and setup the list view and item factory - factory = gtk_signal_list_item_factory_new (); + factory = GTK_SIGNAL_LIST_ITEM_FACTORY (gtk_signal_list_item_factory_new ()); g_signal_connect (factory, "setup", G_CALLBACK(on_tree_setup_factory), NULL); g_signal_connect (factory, "bind", G_CALLBACK(on_tree_bind_factory), NULL); @@ -244,9 +245,10 @@ static void ui_create_tree (GtkWidget *target_widget) /* g_signal_connect (selection_model, "selection-changed", */ /* G_CALLBACK(on_tree_selection_changed), NULL); */ - list_view = gtk_list_view_new (selection_model, factory); + list_view = gtk_list_view_new (GTK_SELECTION_MODEL (selection_model), + GTK_LIST_ITEM_FACTORY (factory)); - scrolled_window = gtk_scrolled_window_new(); + scrolled_window = GTK_SCROLLED_WINDOW (gtk_scrolled_window_new()); gtk_scrolled_window_set_child(scrolled_window, list_view); gtk_scrolled_window_set_policy (scrolled_window, @@ -255,8 +257,8 @@ static void ui_create_tree (GtkWidget *target_widget) gtk_widget_set_vexpand(GTK_WIDGET(scrolled_window), TRUE); gtk_box_append(GTK_BOX(target_widget), GTK_WIDGET(scrolled_window)); - gtk_widget_show(GTK_WIDGET(scrolled_window)); - gtk_widget_show(GTK_WIDGET(list_view)); + gtk_widget_set_visible(GTK_WIDGET(scrolled_window), TRUE); + gtk_widget_set_visible(GTK_WIDGET(list_view), TRUE); } GtkBox *get_rules_user_tree_new(){ @@ -264,7 +266,7 @@ GtkBox *get_rules_user_tree_new(){ // gtk_box_append (tree_sketch, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); // gtk_box_append (tree_sketch, GTK_WIDGET (get_user_tree())); // gtk_box_append (tree_sketch, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - ui_create_tree(tree_sketch); + ui_create_tree(GTK_WIDGET (tree_sketch)); return tree_sketch; } @@ -290,8 +292,8 @@ GtkBox *get_rules_comparator_new(){ GtkWidget *get_rules_tree_hpaned_new(){ GtkPaned *H_tree_vs_comparison = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); - GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre"); - GtkWidget *comparaison_des_règles_sélectionnées = gtk_frame_new ("Sélection"); +// GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre"); +// GtkWidget *comparaison_des_règles_sélectionnées = gtk_frame_new ("Sélection"); gtk_paned_set_start_child (H_tree_vs_comparison, GTK_WIDGET (get_rules_user_tree_new())); gtk_paned_set_end_child (H_tree_vs_comparison, GTK_WIDGET (get_rules_comparator_new())); diff --git a/hot.o b/hot.o index e7e80c4..e7364e2 100644 Binary files a/hot.o and b/hot.o differ diff --git a/main.o b/main.o index 23a8556..968e8d0 100644 Binary files a/main.o and b/main.o differ diff --git a/myprogram b/myprogram index 451bdc8..5c8ce38 100755 Binary files a/myprogram and b/myprogram differ