From 11bcd85d686d82b5efead9f234a4a48efc8ee75a Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 21 Jul 2024 23:17:01 +0200 Subject: [PATCH] C L E A N ++ From there, I will work only in: fsm, widget, signal --- include/fsm.h | 4 ++-- include/signal.h | 2 +- include/widget.h | 45 ++++++++++++++++++++++----------------------- src/fsm.c | 4 ++-- src/signal.c | 25 +++++++++++++------------ src/widget/labo.c | 29 +++++++++++------------------ src/widget/rules.c | 22 +++++++++++----------- src/widget/state.c | 12 ++++++------ src/widget/stock.c | 20 ++++++++++---------- src/widget/topbar.c | 5 +++-- src/widget/tree.c | 4 ++-- 11 files changed, 83 insertions(+), 89 deletions(-) diff --git a/include/fsm.h b/include/fsm.h index b69e8a0..e0b6309 100644 --- a/include/fsm.h +++ b/include/fsm.h @@ -37,8 +37,8 @@ /* S T A T E M A C H I N E */ /******************************************************************************/ -enum choice_EXEC_EDIT { EXEC, EDIT }; // xor -enum choice_STATE_RULES_DATA { STATE, RULES, DATA }; // xor +enum fsm_choice_EXEC_EDIT { EXEC, EDIT }; // xor +enum fsm_choice_STATE_RULES_DATA { STATE, RULES, DATA }; // xor int fsm_get_exec_edit (); int fsm_get_state_rules_data (); diff --git a/include/signal.h b/include/signal.h index ca855fb..288b94f 100644 --- a/include/signal.h +++ b/include/signal.h @@ -2,7 +2,7 @@ * * * Gem-graph client * * * -* Callbacks header * +* Signals header * * * * Copyright © 2021 Libre en Communs * * Copyright © 2021 Adrien Bourmault * diff --git a/include/widget.h b/include/widget.h index f952fe4..fb9ec2b 100644 --- a/include/widget.h +++ b/include/widget.h @@ -53,24 +53,23 @@ void *widget_get_text_window(); /* W I D G E T S */ /******************************************************************************/ -GtkWidget *widget_rec_state_page(); -GtkWidget *widget_rec_rules_page(); -GtkWidget *widget_rec_stock_page(); +void *widget_get_state_page(); +void *widget_get_rules_page(); +void *widget_get_stock_page(); -void reset_all_objects_transparencies_to_value (int value); -void reset_all_situations_transparencies_to_value (int value); +void widget_reset_all_objects_transparencies_to_value (int value); +void widget_reset_all_situations_transparencies_to_value (int value); -GtkWidget *widget_rec_stock_text (gchar *text_name); +void *widget_get_stock_text (gchar *text_name); /******************************************************************************/ /* M E N U */ /******************************************************************************/ -struct MenuNode_t {gchar *text; struct MenuNode_t *child, *next;}; -struct MenuNode_t *widget_create_user_menu_node (const gchar* text); +//struct MenuNode_t {gchar *text; struct MenuNode_t *child, *next;}; +//struct MenuNode_t *widget_create_user_menu_node (const gchar* text); -GtkWidget *widget_rec_menu_anchor(); /******************************************************************************/ @@ -81,37 +80,37 @@ struct TreeNode_t {gchar *text; struct TreeNode_t *child, *next;}; struct TreeNode_t *widget_create_user_tree_node (const gchar* text); void widget_add_child_node (struct TreeNode_t *parent, struct TreeNode_t *child); -void labo_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root); -GtkScrolledWindow *widget_rec_user_rules_tree (); +void *widget_get_user_rules_tree (); /******************************************************************************/ /* I M A G E S */ /******************************************************************************/ -// images are in : data / image / +// images are in : data / image / +// functions are in : widget / stock.c -GtkWidget *widget_rec_image_E_coli(); -GtkWidget *widget_rec_image_GLUTAMATE(); -GtkWidget *widget_rec_image_GLUTAMINE(); -GtkWidget *widget_rec_image_ATP(); -GtkWidget *widget_rec_image_AMP(); +void *widget_get_image_E_coli(); +void *widget_get_image_glutamate(); +void *widget_get_image_glutamine(); +void *widget_get_image_ATP(); +void *widget_get_image_AMP(); /******************************************************************************/ /* T E X T S */ /******************************************************************************/ -// texts are in : data / text / +// texts are in : data / text / +// functions are in : widget / stock.c -gchar *widget_rec_text_address_theory (); -gchar *widget_rec_text_address_about_commands (); -gchar *widget_rec_text_address_any (); +char *widget_get_text_address_theory (); +char *widget_get_text_address_about_commands (); +char *widget_get_text_address_any (); /******************************************************************************/ /* L A B O */ /******************************************************************************/ -void learning_how_to_create_a_menu (GtkMenuButton* menu_button); -void labo_create_a_simple_gtk_string_list (); +void widget_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root); diff --git a/src/fsm.c b/src/fsm.c index 4e697b2..d0991ea 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -73,7 +73,7 @@ void fsm_reset_all_objects_transparencies_at_value (int value) debug_printing (value, 2); // OBJECTS_box_RESET_VALUE is sub_automaton 2 choice_OBJECTS_box_RESET_VALUE = value; - reset_all_objects_transparencies_to_value (value); + widget_reset_all_objects_transparencies_to_value (value); } void fsm_reset_all_situations_transparencies_at_value (int value) @@ -84,7 +84,7 @@ void fsm_reset_all_situations_transparencies_at_value (int value) debug_printing (value, 3); // SITUATIONS_box_RESET_VALUE is sub_automaton 3 choice_SITUATIONS_box_RESET_VALUE = value; - reset_all_situations_transparencies_to_value (value); + widget_reset_all_situations_transparencies_to_value (value); } void fsm_set_situations_box_reset_value (int value) diff --git a/src/signal.c b/src/signal.c index 473418b..524f5ed 100644 --- a/src/signal.c +++ b/src/signal.c @@ -2,7 +2,7 @@ * * * Gem-graph client * * * -* Callbacks header * +* Signals * * * * Copyright © 2021 Libre en Communs * * Copyright © 2021 Adrien Bourmault * @@ -204,21 +204,21 @@ void on_save_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL, { gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE); - printf ("callback.c - SAVE_CURRENT_MODEL_BEFORE_EDITING\n"); + printf ("signal.c - SAVE_CURRENT_MODEL_BEFORE_EDITING\n"); } void on_discard_current_model_before_editing (GtkWidget *btt_SAVE_CURRENT_MODEL, gpointer data) { gtk_window_close (GTK_WINDOW (data)); - printf ("callback.c - DISCARD_CURRENT_MODEL_AND_START_EDITING\n"); + printf ("signal.c - DISCARD_CURRENT_MODEL_AND_START_EDITING\n"); } void on_write_current_model (GtkWidget *btt_WRITE_CURRENT_MODEL, gpointer data) { gtk_window_close (GTK_WINDOW (data)); - printf ("callback.c - WRITE_CURRENT_MODEL\n"); + printf ("signal.c - WRITE_CURRENT_MODEL\n"); } @@ -233,21 +233,21 @@ static void switch_state_rules_data() case (STATE) : gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), - GTK_WIDGET (widget_rec_state_page())); + GTK_WIDGET (widget_get_state_page())); break; case (RULES) : gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), - GTK_WIDGET (widget_rec_rules_page())); + GTK_WIDGET (widget_get_rules_page())); break; case (DATA) : gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()), - GTK_WIDGET (widget_rec_stock_page())); + GTK_WIDGET (widget_get_stock_page())); break; default : - printf("default in callback.on_toggle_state_rule_data()\n"); + printf("default in signal.on_toggle_state_rule_data()\n"); } } @@ -273,6 +273,7 @@ void on_toggle_exec_edit (GtkWidget *toggled_button, gpointer user_data) switch_state_rules_data(); } +// TODO Il doit y avoir plus élégant,... void on_toggle_state_rules_data (GtkWidget *toggled_button, gpointer user_data) { const char *toggled_button_name @@ -321,7 +322,7 @@ void on_clicked_search (GtkWidget *btt_menu, gpointer list_box) { void on_clicked_home (GtkWidget *btt_reset, gpointer data) { - printf ("callback.on_clicked_HOME() button presents the dialog_window\ + printf ("signal.on_clicked_HOME() button presents the dialog_window\ ( :- ) but it works only once.\n"); // TODO gtk_window_present (GTK_WINDOW (widget_get_dialog_window())); } @@ -355,14 +356,14 @@ void on_clicked_home (GtkWidget *btt_reset, gpointer data) /******************************************************************************/ void on_clicked_menu_experiment (GtkWidget *btt_menu, gpointer list_box) { - printf ("callback.on_clicked_MENU() button > %p < &list_box > children nb > 3\n", list_box); + printf ("signal.on_clicked_MENU() button > %p < &list_box > children nb > 3\n", list_box); // gpointer list_box = gtk_popover_get_child (GTK_POPOVER (pop)); /* if (gtk_list_box_get_row_at_index (list_box, 3)) - printf ("callback.on_clicked_MENU() button > %p < &list_box > children nb > 3\n", list_box); - else printf ("callback.on_clicked_MENU() button > in list_box are the three buttons : %s, %s, %s\n\ + printf ("signal.on_clicked_MENU() button > %p < &list_box > children nb > 3\n", list_box); + else printf ("signal.on_clicked_MENU() button > in list_box are the three buttons : %s, %s, %s\n\ and now : how to display these three buttons (and make use of them) ? 2024-07-13 (20h)\n",\ gtk_button_get_label (GTK_BUTTON (gtk_list_box_row_get_child (gtk_list_box_get_row_at_index (list_box, 0)))), gtk_button_get_label (GTK_BUTTON (gtk_list_box_row_get_child (gtk_list_box_get_row_at_index (list_box, 1)))), diff --git a/src/widget/labo.c b/src/widget/labo.c index b16473b..e484850 100644 --- a/src/widget/labo.c +++ b/src/widget/labo.c @@ -68,20 +68,11 @@ /* C O N T A I N E R S */ /******************************************************************************/ -// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO -// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery -// https://iconduck.com/sets/adwaita-icon-theme -// https://iconduck.com/sets/carbon-icons -// https://docs.gtk.org/gtk4/section-text-widget.html -// https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management -// https://docs.gtk.org/gtk4/class.TextView.html -// https://docs.gtk.org/gtk4/class.TextBuffer.html -// https://docs.gtk.org/gtk3/method.TextIter.get_text.html // GTK_ORIENTATION_VERTICAL GTK_ORIENTATION_HORIZONTAL -void labo_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root) { +void widget_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_t *tree_root) { struct TreeNode_t *a = widget_create_user_tree_node("We, the people");widget_add_child_node(tree_root, a); struct TreeNode_t *b = widget_create_user_tree_node("in Order to"); widget_add_child_node(tree_root, b); struct TreeNode_t *c = widget_create_user_tree_node("do establish"); widget_add_child_node(tree_root, c); @@ -113,14 +104,6 @@ void labo_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_t struct TreeNode_t *cc = widget_create_user_tree_node("access"); widget_add_child_node(c, cc); } -void labo_create_a_simple_gtk_string_list () { - char *array[] = {"one", "two", "three", "four", NULL}; - GtkStringList *list = gtk_string_list_new ((const char * const *) array); - for (int i = 0; i < 4; i++) - printf ("in labo.a_simple_gtk_string_list() > list [%d + 1] = %s\n",\ - i, - gtk_string_list_get_string (list, i)); -} /* "rule effect" @@ -162,6 +145,16 @@ void labo_create_a_simple_gtk_string_list () { */ +// https://blog.gtk.org/2020/09/08/on-list-models/ < TODO +// https://docs.gtk.org/gtk4/visual_index.html < widgets gallery +// https://iconduck.com/sets/adwaita-icon-theme +// https://iconduck.com/sets/carbon-icons +// https://docs.gtk.org/gtk4/section-text-widget.html +// https://docs.gtk.org/gtk4/class.Widget.html#height-for-width-geometry-management +// https://docs.gtk.org/gtk4/class.TextView.html +// https://docs.gtk.org/gtk4/class.TextBuffer.html +// https://docs.gtk.org/gtk3/method.TextIter.get_text.html + /* https://iconduck.com/sets/adwaita-icon-theme https://iconduck.com/sets/carbon-icons < pas mal ... diff --git a/src/widget/rules.c b/src/widget/rules.c index 0925099..d26c6e4 100644 --- a/src/widget/rules.c +++ b/src/widget/rules.c @@ -40,14 +40,14 @@ static GtkWidget *rec_selected_rules_vpaned_new() { gtk_paned_set_shrink_end_child (EXEC_CONTROLS_pane, FALSE); GtkBox *up_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - gtk_box_append (up_box, GTK_WIDGET (widget_rec_image_GLUTAMATE())); + gtk_box_append (up_box, GTK_WIDGET (widget_get_image_glutamate())); gtk_box_append (up_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); - gtk_box_append (up_box, GTK_WIDGET (widget_rec_image_GLUTAMINE())); + gtk_box_append (up_box, GTK_WIDGET (widget_get_image_glutamine())); GtkBox *bottom_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); - gtk_box_append (bottom_box, GTK_WIDGET (widget_rec_image_ATP())); + gtk_box_append (bottom_box, GTK_WIDGET (widget_get_image_ATP())); gtk_box_append (bottom_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); - gtk_box_append (bottom_box, GTK_WIDGET (widget_rec_image_AMP())); + gtk_box_append (bottom_box, GTK_WIDGET (widget_get_image_AMP())); gtk_paned_set_start_child (EXEC_CONTROLS_pane, GTK_WIDGET (up_box)); gtk_paned_set_end_child (EXEC_CONTROLS_pane, GTK_WIDGET (bottom_box)); @@ -58,13 +58,13 @@ static GtkWidget *rec_selected_rules_vpaned_new() { static GtkBox *rec_rules_comparator_new(){ GtkBox *comparator = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_widget_set_size_request (GTK_WIDGET (comparator), W_IMAGE_LOCAL, H_IMAGE_LOCAL); - gtk_box_append (comparator, GTK_WIDGET (widget_rec_image_ATP())); + gtk_box_append (comparator, GTK_WIDGET (widget_get_image_ATP())); gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (comparator, GTK_WIDGET (widget_rec_image_AMP())); + gtk_box_append (comparator, GTK_WIDGET (widget_get_image_AMP())); gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (comparator, GTK_WIDGET (widget_rec_image_GLUTAMATE())); + gtk_box_append (comparator, GTK_WIDGET (widget_get_image_glutamate())); gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); - gtk_box_append (comparator, GTK_WIDGET (widget_rec_image_GLUTAMINE())); + gtk_box_append (comparator, GTK_WIDGET (widget_get_image_glutamine())); gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); gtk_box_append (comparator, GTK_WIDGET (gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/histidine.png"))); gtk_box_append (comparator, GTK_WIDGET(gtk_separator_new (GTK_ORIENTATION_HORIZONTAL))); @@ -80,8 +80,8 @@ static GtkWidget *rec_rules_tree_hpaned_new(){ // 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 (widget_rec_user_rules_tree())); +// GTK_SCROLLED_WINDOW + gtk_paned_set_start_child (H_tree_vs_comparison, GTK_WIDGET (widget_get_user_rules_tree())); gtk_paned_set_end_child (H_tree_vs_comparison, GTK_WIDGET (rec_rules_comparator_new())); gtk_paned_set_position (H_tree_vs_comparison, 300); gtk_paned_set_wide_handle (H_tree_vs_comparison, TRUE); @@ -91,7 +91,7 @@ static GtkWidget *rec_rules_tree_hpaned_new(){ return GTK_WIDGET (H_tree_vs_comparison); } -GtkWidget *widget_rec_rules_page() { +void *widget_get_rules_page() { GtkPaned *H_tree_vs_selected = GTK_PANED (gtk_paned_new (GTK_ORIENTATION_HORIZONTAL)); // GtkWidget *arbre_des_règles = gtk_frame_new ("Arbre des règles"); // GtkWidget *édition_de_la_règle_sélectionnée_n_1 = gtk_frame_new ("Inspection"); diff --git a/src/widget/state.c b/src/widget/state.c index 8d9283f..f9c4c88 100644 --- a/src/widget/state.c +++ b/src/widget/state.c @@ -91,7 +91,7 @@ static GtkBox *rec_ZOOM_box() static GtkScrollbar *object_bar [n_objects]; static GtkAdjustment *object_adjust [n_objects]; -void reset_all_objects_transparencies_to_value (int value) +void widget_reset_all_objects_transparencies_to_value (int value) { for (int i = 0; i < n_objects; i++) if (value > -1) @@ -127,7 +127,7 @@ static GtkBox *rec_OBJECTS_box() gtk_box_append (objects_box, GTK_WIDGET (object_bar [i])); } - reset_all_objects_transparencies_to_value (-1); + widget_reset_all_objects_transparencies_to_value (-1); return objects_box; } @@ -135,7 +135,7 @@ static GtkBox *rec_OBJECTS_box() static GtkScrollbar *situation_bar [n_situations]; static GtkAdjustment *situation_adjust [n_situations]; -void reset_all_situations_transparencies_to_value (int value) +void widget_reset_all_situations_transparencies_to_value (int value) { for (int i = 0; i < n_situations; i++) if (value > -1) @@ -173,7 +173,7 @@ static GtkBox *rec_SITUATIONS_box() gtk_box_append (situations_box, GTK_WIDGET (situation_bar [i])); } - reset_all_situations_transparencies_to_value (-1); + widget_reset_all_situations_transparencies_to_value (-1); return situations_box; } @@ -219,7 +219,7 @@ static GtkWidget *rec_SPACE_VIEW_box() GtkBox *central_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); // TODO - gtk_box_append (central_box, GTK_WIDGET (widget_rec_image_E_coli())); + gtk_box_append (central_box, GTK_WIDGET (widget_get_image_E_coli())); // ui_setup_glarea (0, GTK_WIDGET (central_box)); gtk_box_append (central_box, GTK_WIDGET (gtk_separator_new (GTK_ORIENTATION_VERTICAL))); @@ -270,7 +270,7 @@ static GtkWidget *rec_SEQUENCE_CONTROL_box() * - CONTRAST en haut permet de modifier un à un les contrastes des objets et des situations * afin de mieux mettre en évidence l'objet ou le phénomène d'intérêt */ -GtkWidget *widget_rec_state_page() +void *widget_get_state_page() { GtkBox *page_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); gtk_box_append (page_box, GTK_WIDGET (rec_OBJECTS_and_SITUATIONS())); diff --git a/src/widget/stock.c b/src/widget/stock.c index 0b0bbac..82d46c3 100644 --- a/src/widget/stock.c +++ b/src/widget/stock.c @@ -31,7 +31,7 @@ #include "../../include/signal.h" #include "../../include/widget.h" -GtkWidget *widget_rec_stock_page () { +void *widget_get_stock_page () { GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 32)); GtkWidget* frame_rule_effect = gtk_frame_new ("rule effect"); @@ -64,7 +64,7 @@ GtkWidget *widget_rec_stock_page () { return GTK_WIDGET (data_box); } -GtkWidget *widget_rec_stock_text (gchar *text_address) { +void *widget_get_stock_text (gchar *text_address) { GtkWidget *view = gtk_text_view_new (); GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); gtk_text_buffer_set_text (buffer, read_file (text_address), -1); @@ -85,15 +85,15 @@ GtkWidget *widget_rec_stock_text (gchar *text_address) { /* T E X T S */ /******************************************************************************/ -gchar *widget_rec_text_address_theory () { +char *widget_get_text_address_theory () { return "/home/jean/Gem-Graph/gem-graph-client/data/text/théorie.txt"; } -gchar *widget_rec_text_address_about_commands () { +char *widget_get_text_address_about_commands () { return "/home/jean/Gem-Graph/gem-graph-client/data/text/about_commands.txt"; } -gchar *widget_rec_text_address_any () { +char *widget_get_text_address_any () { return "/home/jean/Gem-Graph/gem-graph-client/data/text/any.txt"; } @@ -103,31 +103,31 @@ gchar *widget_rec_text_address_any () { /* I M A G E S */ /******************************************************************************/ -GtkWidget *widget_rec_image_E_coli(){ +void *widget_get_image_E_coli(){ GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/E coli by D Goodsell.png"); return image; } -GtkWidget *widget_rec_image_GLUTAMATE(){ +void *widget_get_image_glutamate(){ GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/glutamate.png"); return image; } -GtkWidget *widget_rec_image_GLUTAMINE(){ +void *widget_get_image_glutamine(){ GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/glutamine.png"); return image; } -GtkWidget *widget_rec_image_ATP(){ +void *widget_get_image_ATP(){ GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/ATP.png"); return image; } -GtkWidget *widget_rec_image_AMP(){ +void *widget_get_image_AMP(){ GtkWidget *image = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/AMP.png"); return image; diff --git a/src/widget/topbar.c b/src/widget/topbar.c index 0a34e2a..91267b5 100644 --- a/src/widget/topbar.c +++ b/src/widget/topbar.c @@ -50,8 +50,8 @@ void widget_design_text_window (GtkWindow *main_window, GtkWindow *text_window) gtk_header_bar_set_title_widget (GTK_HEADER_BAR (header_bar), gtk_label_new (title)); gtk_window_set_titlebar (text_window, header_bar); - GtkWidget *child = widget_rec_stock_text (widget_rec_text_address_theory()); - child = widget_rec_stock_text (widget_rec_text_address_about_commands()); + GtkWidget *child = widget_get_stock_text (widget_get_text_address_theory()); + child = widget_get_stock_text (widget_get_text_address_about_commands()); gtk_window_set_child (GTK_WINDOW (text_window), GTK_WIDGET (child)); gtk_widget_set_size_request (GTK_WIDGET (child), W_TEXT_WINDOW, H_TEXT_WINDOW); @@ -289,3 +289,4 @@ static void window_header_bar_right (GtkWidget *header_bar) // gtk_button_set_icon_name (search, "preferences-desktop-appearance-symbolic"); // gtk_button_set_icon_name (search, "applications-utilities-symbolic"); + diff --git a/src/widget/tree.c b/src/widget/tree.c index 5644807..8035e94 100644 --- a/src/widget/tree.c +++ b/src/widget/tree.c @@ -83,10 +83,10 @@ static GListModel *get_user_tree_model (GObject *item, gpointer root) return get_user_tree_model_child (cur); } -GtkScrolledWindow *widget_rec_user_rules_tree () +void *widget_get_user_rules_tree () { struct TreeNode_t *tree_root = widget_create_user_tree_node("root"); - labo_let_us_create_a_complex_useless_and_expensive_tree (tree_root); + widget_let_us_create_a_complex_useless_and_expensive_tree (tree_root); GtkStringList *model = gtk_string_list_new(NULL); gtk_string_list_append (model, tree_root->text);