g_signal_connect (run_xor_edit, clicked, G_CALLBACK (ui_toggle_run_edit), NULL); << ça marche

This commit is contained in:
Jean Sirmai 2024-06-02 05:45:50 +02:00
parent e7badf5d9a
commit 14b0c84e11
Signed by: jean
GPG Key ID: FB3115C340E057E3
5 changed files with 4 additions and 70 deletions

View File

@ -6,38 +6,16 @@
#include "contain.h"
#include "texts.h"
void ui_toggle_run_edit()
void ui_toggle_run_edit (GtkWidget *btt_run_xor_edit, gpointer data)
{
if (!get_run_edit_mode()) {g_printerr("Can't find self->main_button_run_edit !\n"); return;}
printf("window.ui_toggle_run_edit() >>> mode = %d", get_run_edit_mode ());
if (get_run_edit_mode()) {
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "system-run-symbolic");
gtk_button_set_icon_name (GTK_BUTTON (btt_run_xor_edit), "system-run-symbolic");
set_run_edit_mode (0);
} else {
gtk_button_set_icon_name (GTK_BUTTON (get_btt_run_xor_edit()), "document-edit-symbolic");
gtk_button_set_icon_name (GTK_BUTTON (btt_run_xor_edit), "document-edit-symbolic");
set_run_edit_mode (1);
}
printf(" > %d\n", get_run_edit_mode ());
}
void on_togglerunedit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {
// GemGraphClientApplication *self = user_data;
// g_assert (GEM_GRAPH_CLIENT_IS_APPLICATION(self));
printf("| >>> callback.on_togglerunedit_action() >>> ");
ui_toggle_run_edit ();
}
void on_quit_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_about_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_preferences_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_togglerunstop_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_togglesidebar_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_editmode_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_runmode_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_presentmode_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_openfile_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_closefile_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_savefile_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}
void on_toast_close_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) {}

Binary file not shown.

View File

@ -296,61 +296,17 @@ void two_notebooks_in_two_panes (GtkWindow *window) {
q
GtkButton *get_btt_run_xor_edit() {
GtkButton *run_xor_edit = GTK_BUTTON (gtk_toggle_button_new ());
gtk_button_set_icon_name (run_xor_edit, "system-run-symbolic");
g_signal_connect (run_xor_edit, "clicked", G_CALLBACK (ui_toggle_run_edit), NULL);
return run_xor_edit;
}
void activate (GtkApplication *self, gpointer user_data) {
GtkWindow *window = GTK_WINDOW (gtk_application_window_new (self));
window_bar (window, "E coli (with permission from David S. Goodsell, 2009)");
two_notebooks_in_two_panes (window);
gtk_window_present (GTK_WINDOW (window));
g_signal_connect (get_btt_run_xor_edit(),
"clicked",
G_CALLBACK (on_togglerunedit_action),
NULL);
}
/*------------------------------------------------------------------------------
struct _MyApplication {GtkApplication parent_instance;};
G_DEFINE_TYPE (MyApplication,
my_application,
GTK_TYPE_APPLICATION)
static MyApplication *application;
void ui_enable_action (const char *name) {
g_simple_action_set_enabled (
(GSimpleAction *)g_action_map_lookup_action(
G_ACTION_MAP(application),
name),
true);
}
void ui_disable_action (const char *name) {
g_simple_action_set_enabled (
(GSimpleAction *)g_action_map_lookup_action(
G_ACTION_MAP(application),
name),
false);
}
// Action records are registered here
static void my_application_init (MyApplication *self)
{
g_action_map_add_action_entries(G_ACTION_MAP(self),
app_actions,
G_N_ELEMENTS(app_actions),
self);
application = self;
}
*/

BIN
contain.o

Binary file not shown.

BIN
myprogram

Binary file not shown.