changeset 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 38b08f94be27
children cf567a0a7b8c
files src/menu.cc
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/menu.cc	Wed May 25 23:37:57 2011 +0000
+++ b/src/menu.cc	Thu May 26 02:51:18 2011 +0000
@@ -43,6 +43,10 @@
 
 
 //--------------------------------------------------------------------------
+static void Menu_nop_cb(Fl_Widget *, void *)
+{
+}
+
 /*
  * Static function for File menu callbacks.
  */
@@ -295,7 +299,8 @@
    static Fl_Menu_Item pm[] = {
       {"View page source", 0, Menu_view_page_source_cb,0,0,0,0,0,0},
       {"View page bugs", 0, Menu_view_page_bugs_cb,0,0,0,0,0,0},
-      {"View stylesheets", 0, 0, 0,FL_SUBMENU_POINTER|FL_MENU_DIVIDER,0,0,0,0},
+      {"View stylesheets", 0, Menu_nop_cb,0,FL_SUBMENU_POINTER|FL_MENU_DIVIDER,
+       0,0,0,0},
       {"Bookmark this page", 0,Menu_add_bookmark_cb,0,FL_MENU_DIVIDER,0,0,0,0},
       {"Find text", 0, Menu_find_text_cb,0,0,0,0,0,0},
       {"Save page as...", 0, Menu_save_page_cb,0,0,0,0,0,0},
@@ -622,7 +627,7 @@
        FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0},
       {"Load images", 0, Menu_imgload_toggle_cb, 0,
        FL_MENU_TOGGLE|FL_MENU_DIVIDER,0,0,0,0},
-      {"Panel size", 0, 0, (void*)"Submenu1", FL_SUBMENU,0,0,0,0},
+      {"Panel size", 0, Menu_nop_cb, (void*)"Submenu1", FL_SUBMENU,0,0,0,0},
          {"tiny",  0,Menu_panel_change_cb,(void*)0,FL_MENU_RADIO,0,0,0,0},
          {"small", 0,Menu_panel_change_cb,(void*)1,FL_MENU_RADIO,0,0,0,0},
          {"medium",0,Menu_panel_change_cb,(void*)2,FL_MENU_RADIO,0,0,0,0},