static void window_load(Window *window) { char * buff = (char*)malloc(100 * sizeof(char*)); if(amount > 1) snprintf(buff, 100, "Are you sure you want to send $%2d.00 to %s?", (int)amount, cont_name); else snprintf(buff, 100, "Are you sure you want to send $0.10 to %s?", cont_name); tlayer = text_layer_create(GRect(0, 0, 144, 55 + 12)); text_layer_set_text(tlayer, buff); text_layer_set_background_color(tlayer, GColorClear); text_layer_set_text_color(tlayer, GColorBlack); text_layer_set_text_alignment(tlayer, GTextAlignmentCenter); text_layer_set_font(tlayer, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD)); layer_add_child(window_get_root_layer(window), text_layer_get_layer(tlayer)); menu_layer = menu_layer_create(GRect(0, 55 + 12, 144, 152 - 55 - 12)); menu_layer_set_click_config_onto_window(menu_layer, cpay_window); MenuLayerCallbacks callbacks = { .draw_row = (MenuLayerDrawRowCallback) draw_row_callback, .get_num_rows = (MenuLayerGetNumberOfRowsInSectionsCallback) num_rows_callback, .select_click = (MenuLayerSelectCallback) select_click_callback, }; menu_layer_set_callbacks(menu_layer, NULL, callbacks); layer_add_child(window_get_root_layer(cpay_window), menu_layer_get_layer(menu_layer)); free(buff); } void cpay_deinit() { window_push--; window_destroy(cpay_window); menu_layer_destroy(menu_layer); }
static void window_unload( Window *window ) { save_event_reminders(); if ( tz_message != NULL ) text_layer_destroy(tz_message); menu_layer_destroy(event_menu); }
static void destroy_ui(void) { window_destroy(s_window); inverter_layer_destroy(s_inverterlayer_1); text_layer_destroy(s_stop_name_layer); text_layer_destroy(s_direction_layer); menu_layer_destroy(s_train_menu); }
static void destroy_ui(void) { window_destroy(s_window); text_layer_destroy(s_statusbar); text_layer_destroy(s_train_number); text_layer_destroy(s_train_type); menu_layer_destroy(s_stop_list); }
void window_unload(Window *window) { hide_message(); menu_layer_destroy(menu_layer); #ifdef PBL_PLATFORM_BASALT status_bar_layer_destroy(bar_layer); #endif window_destroy(window); }
static void prv_window_unload(Window *window) { GoalStarConfigurationWindowData *data = window_get_user_data(window); if (data) { // TODO replace with SDK NumberWindow once it gets updated to support larger numbers goal_star_number_window_destroy(data->number_window); menu_layer_destroy(data->menu_layer); text_layer_destroy(data->title_layer); window_destroy(data->window); } free(data); }
static void destroy_ui(void) { window_destroy(s_window); menu_layer_destroy(s_menu_layer); text_layer_destroy(s_textlayer_1); text_layer_destroy(s_textlayer_2); gbitmap_destroy(bbc_image1); gbitmap_destroy(bbc_image2); gbitmap_destroy(bbc_image3); #ifndef PBL_PLATFORM_APLITE if(s_bitmap) { gbitmap_destroy(s_bitmap); s_bitmap = NULL; } if(s_sequence) { gbitmap_sequence_destroy(s_sequence); s_sequence = NULL; } bitmap_layer_destroy(s_bitmap_layer); #endif }
void emergency_conf_window_unload(Window *window) { menu_layer_destroy(menu_layer); }
static void main_window_unload(Window *window) { // Destroy the menu layer menu_layer_destroy(s_menu_layer); }
void airplay_deinit(void) { APP_LOG(APP_LOG_LEVEL_DEBUG, "Window - Spotify deinit %p", window); // save some stuff menu_layer_destroy(menu_layer); window_destroy(window); }
void deinit(void) { menu_layer_destroy(mainMenu); window_destroy(window); }
static void main_window_unload(Window *window) { menu_layer_destroy(menu_schedule); }
static void destroy_ui(void) { window_destroy(s_window); menu_layer_destroy(action_menu); }
static void destroy_ui(void) { window_destroy(s_window); menu_layer_destroy(s_menulayer_1); text_layer_destroy(s_textlayer_1); }
void window_unload(Window *window) { menu_layer_destroy(s_menu_layer); s_main_window = NULL; }
void menu_unload(Window *window) { menu_layer_destroy(menu_layer); }
static void destroy_ui(void) { window_destroy(s_window); menu_layer_destroy(s_menulayer); }
static void window_unload(Window *window) { menu_layer_destroy(menu_layer); }
static void window_unload(Window *window) { menu_layer_destroy(s_menu_layer); window_destroy(s_main_window); }
static void top_list_unload(Window* window) { menu_layer_destroy(ui.menu->menuLayer); free(ui.menu); }
static void destroy_ui(void) { window_destroy(s_window); menu_layer_destroy(settings_layer); unload_periodset(); if (s_settings_closed != NULL) s_settings_closed(); }
static void details_list_unload(Window* window) { for(int i = 0; i < kana_app_getCharCount(selectedIndex); i++) gbitmap_destroy(icons[i]); menu_layer_destroy(details_ui.menu->menuLayer); free(details_ui.menu); }