comparison src/menu.cc @ 2048:5060d415a85a

clickable menu items (even those introducing submenus) MUST have callbacks I clicked on the "Panel size" item itself instead of any of the options in its submenu, and: Segfault!
author corvid <corvid@lavabit.com>
date Thu, 26 May 2011 02:51:18 +0000
parents f542084fa707
children e6a6cf3aab0f
comparison
equal deleted inserted replaced
2047:38b08f94be27 2048:5060d415a85a
41 // History popup, list of URL-indexes. 41 // History popup, list of URL-indexes.
42 static int *history_list = NULL; 42 static int *history_list = NULL;
43 43
44 44
45 //-------------------------------------------------------------------------- 45 //--------------------------------------------------------------------------
46 static void Menu_nop_cb(Fl_Widget *, void *)
47 {
48 }
49
46 /* 50 /*
47 * Static function for File menu callbacks. 51 * Static function for File menu callbacks.
48 */ 52 */
49 static void filemenu_cb(Fl_Widget *wid, void *data) 53 static void filemenu_cb(Fl_Widget *wid, void *data)
50 { 54 {
293 297
294 static Fl_Menu_Item *stylesheets = NULL; 298 static Fl_Menu_Item *stylesheets = NULL;
295 static Fl_Menu_Item pm[] = { 299 static Fl_Menu_Item pm[] = {
296 {"View page source", 0, Menu_view_page_source_cb,0,0,0,0,0,0}, 300 {"View page source", 0, Menu_view_page_source_cb,0,0,0,0,0,0},
297 {"View page bugs", 0, Menu_view_page_bugs_cb,0,0,0,0,0,0}, 301 {"View page bugs", 0, Menu_view_page_bugs_cb,0,0,0,0,0,0},
298 {"View stylesheets", 0, 0, 0,FL_SUBMENU_POINTER|FL_MENU_DIVIDER,0,0,0,0}, 302 {"View stylesheets", 0, Menu_nop_cb,0,FL_SUBMENU_POINTER|FL_MENU_DIVIDER,
303 0,0,0,0},
299 {"Bookmark this page", 0,Menu_add_bookmark_cb,0,FL_MENU_DIVIDER,0,0,0,0}, 304 {"Bookmark this page", 0,Menu_add_bookmark_cb,0,FL_MENU_DIVIDER,0,0,0,0},
300 {"Find text", 0, Menu_find_text_cb,0,0,0,0,0,0}, 305 {"Find text", 0, Menu_find_text_cb,0,0,0,0,0,0},
301 {"Save page as...", 0, Menu_save_page_cb,0,0,0,0,0,0}, 306 {"Save page as...", 0, Menu_save_page_cb,0,0,0,0,0,0},
302 {0,0,0,0,0,0,0,0,0} 307 {0,0,0,0,0,0,0,0,0}
303 }; 308 };
620 {"Use remote CSS", 0, Menu_remote_css_cb, 0, FL_MENU_TOGGLE,0,0,0,0}, 625 {"Use remote CSS", 0, Menu_remote_css_cb, 0, FL_MENU_TOGGLE,0,0,0,0},
621 {"Use embedded CSS", 0, Menu_embedded_css_cb, 0, 626 {"Use embedded CSS", 0, Menu_embedded_css_cb, 0,
622 FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0}, 627 FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0},
623 {"Load images", 0, Menu_imgload_toggle_cb, 0, 628 {"Load images", 0, Menu_imgload_toggle_cb, 0,
624 FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0}, 629 FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0},
625 {"Panel size", 0, 0, (void*)"Submenu1", FL_SUBMENU,0,0,0,0}, 630 {"Panel size", 0, Menu_nop_cb, (void*)"Submenu1", FL_SUBMENU,0,0,0,0},
626 {"tiny", 0,Menu_panel_change_cb,(void*)0,FL_MENU_RADIO,0,0,0,0}, 631 {"tiny", 0,Menu_panel_change_cb,(void*)0,FL_MENU_RADIO,0,0,0,0},
627 {"small", 0,Menu_panel_change_cb,(void*)1,FL_MENU_RADIO,0,0,0,0}, 632 {"small", 0,Menu_panel_change_cb,(void*)1,FL_MENU_RADIO,0,0,0,0},
628 {"medium",0,Menu_panel_change_cb,(void*)2,FL_MENU_RADIO,0,0,0,0}, 633 {"medium",0,Menu_panel_change_cb,(void*)2,FL_MENU_RADIO,0,0,0,0},
629 {"large", 0,Menu_panel_change_cb,(void*)3, 634 {"large", 0,Menu_panel_change_cb,(void*)3,
630 FL_MENU_RADIO|FL_MENU_DIVIDER,0,0,0,0}, 635 FL_MENU_RADIO|FL_MENU_DIVIDER,0,0,0,0},