diff --git a/callback.c b/callback.c index bfd3043..84aa6b8 100644 --- a/callback.c +++ b/callback.c @@ -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) {} - - diff --git a/callback.o b/callback.o index 2ce517f..fcac212 100644 Binary files a/callback.o and b/callback.o differ diff --git a/contain.c b/contain.c index a4331b7..d2aa205 100644 --- a/contain.c +++ b/contain.c @@ -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; -} -*/ diff --git a/contain.o b/contain.o index 59c5eaf..57555df 100644 Binary files a/contain.o and b/contain.o differ diff --git a/myprogram b/myprogram index 6c014fe..5970210 100755 Binary files a/myprogram and b/myprogram differ