From 8752670c1cd4f39f993dc791cf8925a1aa39a4a5 Mon Sep 17 00:00:00 2001 From: NatsuDrag9 Date: Fri, 29 Jun 2018 10:32:37 +0530 Subject: Update - processors are selected and displayed. --- ldmicro/ldmicro.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ldmicro') diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp index be02fd5..7a39478 100644 --- a/ldmicro/ldmicro.cpp +++ b/ldmicro/ldmicro.cpp @@ -896,6 +896,15 @@ gboolean LD_WM_Command_call(GtkMenuItem* men, gpointer gpcode) return FALSE; } +void ProcessorCall(GtkCheckMenuItem* men, gpointer gpcode) +{ + int tempcode = GPOINTER_TO_INT(gpcode); + if(gtk_check_menu_item_get_active(men)) + { + ProcessMenu (tempcode); + } +} + gboolean LD_WM_SetFocus_call(GtkWidget *widget, GdkEvent *event, gpointer user_data) { /* Handles: @@ -1144,6 +1153,12 @@ inline void MenuHandler () g_signal_connect(G_OBJECT(AboutMenu), "activate", G_CALLBACK(LD_WM_Command_call), GINT_TO_POINTER(MNU_ABOUT)); + // Connect microcontroller signals automatically + for(int i = 0; i < NUM_SUPPORTED_MCUS; i++) + { + g_signal_connect(G_OBJECT(ProcessorMenuItems[i]), "toggled", + G_CALLBACK(ProcessorCall), GINT_TO_POINTER((MNU_PROCESSOR_0 + i))); + } } //----------------------------------------------------------------------------- -- cgit