Contents in release-21-2 at 1999-06-30-19.
[chise/xemacs-chise.git.1] / src / menubar-x.c
index f9c5349..6212281 100644 (file)
@@ -122,11 +122,17 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
        {
          wv->name = string_chars;
          wv->enabled = 1;
+         /* dverna Dec. 98: command_builder_operate_menu_accelerator will
+            manipulate the accel as a Lisp_Object if the widget has a name.
+            Since simple labels have a name, but no accel, we *must* set it
+            to nil */
+         wv->accel = LISP_TO_VOID (Qnil);
        }
     }
   else if (VECTORP (desc))
     {
-      if (!button_item_to_widget_value (desc, wv, 1,
+      Lisp_Object gui_item = gui_parse_item_keywords (desc);
+      if (!button_item_to_widget_value (gui_item, wv, 1,
                                        (menu_type == MENUBAR_TYPE
                                         && depth <= 1)))
        {
@@ -152,7 +158,7 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
          wv->enabled = 1;
          wv->name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc)));
 
-         accel = menu_name_to_accelerator (wv->name);
+         accel = gui_name_accelerator (LISP_GETTEXT (XCAR (desc)));
          wv->accel = LISP_TO_VOID (accel);
 
          desc = Fcdr (desc);
@@ -460,10 +466,12 @@ pre_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
          wv = xmalloc_widget_value ();
          wv->type = CASCADE_TYPE;
          wv->next = NULL;
+         wv->accel = LISP_TO_VOID (Qnil);
          wv->contents = xmalloc_widget_value ();
          wv->contents->type = TEXT_TYPE;
          wv->contents->name = (char *) "No menu";
          wv->contents->next = NULL;
+         wv->contents->accel = LISP_TO_VOID (Qnil);
        }
       assert (wv && wv->type == CASCADE_TYPE && wv->contents);
       replace_widget_value_tree (hack_wv, wv->contents);
@@ -567,7 +575,7 @@ set_frame_menubar (struct frame *f, int deep_p, int first_time_p)
   if (NILP (FRAME_MENUBAR_DATA (f)))
     {
       struct popup_data *mdata =
-       alloc_lcrecord_type (struct popup_data, lrecord_popup_data);
+       alloc_lcrecord_type (struct popup_data, &lrecord_popup_data);
 
       mdata->id = new_lwlib_id ();
       mdata->last_menubar_buffer = Qnil;