Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Creating the menu items and sections
- void set_up_menu_stuff() {
- int i;
- for(i=0; i < (int)sizeof(menu_items)/ (int)sizeof(menu_items[0]); i++) {
- menu_items[i] = (SimpleMenuItem) {
- .title = menu_options[i],
- .callback = simple_menu_callback(i) /* I believe this is a part of the problem here */
- };
- switch(i) {
- case 0:
- menu_items[i].subtitle = "Add an alarm clock";
- break;
- case 1:
- menu_items[i].subtitle = "Edit an alarm clock";
- break;
- case 2:
- menu_items[i].subtitle = "Delete an alarm clock";
- break;
- };
- };
- menu_sections[0] = (SimpleMenuSection) {
- .title = "Options",
- .items = menu_items,
- .num_items = 3
- };
- }
- void simple_menu_callback_function(int option) {
- // Option is supposed to be the index number passed through based on which menu item is clicked
- window = window_create();
- if(option == 0) {
- text_layer = text_layer_create(layer_get_frame(window_dimensions));
- text_layer_set_text(text_layer,"Filler for adding an alarm clock!");
- } else if(option == 1) {
- text_layer = text_layer_create(layer_get_frame(window_dimensions));
- text_layer_set_text(text_layer,"Filler for editing an alarm clock!");
- } else if(option == 2) {
- text_layer = text_layer_create(layer_get_frame(window_dimensions));
- text_layer_set_text(text_layer,"Filler for deleting an alarm clock!");
- } else {
- printf("Something went wrong trying to send option data to deeper callback function\n");
- }
- layer_add_child(window_get_root_layer(window),(Layer*)text_layer);
- }
- /* The error I get is:
- error: void value not ignored as it ought to be */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement