static void menu_select_callback(int index, void *ctx) { Valve_s* v = getValveByIndex(index); //SimpleMenuItem* i = &s_first_menu_items[index]; //i->subtitle = "Openning ...."; //layer_mark_dirty(simple_menu_layer_get_layer(s_simple_menu_layer)); selectedValve = v; ActionMenuConfig config = (ActionMenuConfig){ .root_level = s_action_menu }; action_menu_open(&config); }
action_menu_level_add_action(s_root_level, "Z", action_performed_callback, (void *) Z); } static void action_menu_config_init(){ ActionMenuConfig config = (ActionMenuConfig) { .root_level = s_root_level, .colors = { .background = GColorWindsorTan, .foreground = GColorBlack, }, .align = ActionMenuAlignCenter }; // Show the ActionMenu s_action_menu = action_menu_open(&config); } static void select(struct MenuLayer *menu_layer, MenuIndex *cell_index, void *callback_context){ init_action_menu(); // init the menu for each letter action_menu_config_init(); // config colors and opens the menu } // ------------------------------------------------------------------------------------------------------- // Windows Load and Unload // ------------------------------------------------------------------------------------------------------- static void window_load(Window *window) { Layer *window_layer = window_get_root_layer(window); GRect bounds = layer_get_bounds(window_layer); // Letter layers