WIP: on repart du 'design' de la barre de titre simplifié

This commit is contained in:
Jean Sirmai 2024-06-17 21:24:24 +02:00
parent 31957b7835
commit 53f2fea60c
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 8 additions and 34 deletions

View File

@ -184,22 +184,14 @@ void window_header_bar (GtkWindow *window, char *title){
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_RULES), group_STATE_RULES_DATA); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_RULES), group_STATE_RULES_DATA);
gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_DATA), group_STATE_RULES_DATA); gtk_check_button_set_group (GTK_CHECK_BUTTON (btt_open_DATA), group_STATE_RULES_DATA);
int selected = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE));
printf("%d\n", selected);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE)))
g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), NULL);
else
g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), NULL);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_RULES)))
g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), NULL);
else
g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), NULL);
g_signal_connect (btt_open_DATA, "toggled", G_CALLBACK (on_open_DATA), no_local_data);
gtk_check_button_set_active (GTK_CHECK_BUTTON (btt_open_STATE), TRUE); gtk_check_button_set_active (GTK_CHECK_BUTTON (btt_open_STATE), TRUE);
// int selected = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE));
// if (0) printf("%d\n", selected);
// if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (btt_open_STATE)))
// g_signal_connect (btt_open_STATE, "toggled", G_CALLBACK (on_open_STATE), no_local_data);
// g_signal_connect (btt_open_RULES, "toggled", G_CALLBACK (on_open_RULES), no_local_data);
// g_signal_connect (btt_open_DATA, "toggled", G_CALLBACK (on_open_DATA), no_local_data);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_XOR_EXEC_EDIT)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_XOR_EXEC_EDIT));
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_MODEL_RUN_STOP)); gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), GTK_WIDGET (btt_MODEL_RUN_STOP));
@ -211,24 +203,6 @@ void window_header_bar (GtkWindow *window, char *title){
icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme icons_for_fun (GTK_HEADER_BAR (header_bar)); // https://iconduck.com/sets/adwaita-icon-theme
} }
static void output_state (GtkToggleButton *source, gpointer user_data) {
g_print ("Toggle button %s is active: %s\n",
gtk_button_get_label (GTK_BUTTON (source)),
gtk_toggle_button_get_active (source) ? "Yes" : "No");
}
static void make_toggles (void) {
GtkWidget *toggle1, *toggle2;
toggle1 = gtk_toggle_button_new_with_label ("Hi, Im toggle button one");
g_signal_connect (toggle1, "toggled", G_CALLBACK (output_state), NULL);
toggle2 = gtk_toggle_button_new_with_label ("Hi, Im toggle button two");
g_signal_connect (toggle2, "toggled", G_CALLBACK (output_state), NULL);
}
void window_main_child (GtkWindow *main_window, int selected_page){ void window_main_child (GtkWindow *main_window, int selected_page){
/* /*
switch (selected_page) { switch (selected_page) {