changeset 6481:55236c5bca7c

(update_frame_menubar): Function renamed from update_one_frame_psheets. (initialize_frame_menubar): New function. (set_frame_menubar): Call menu_bar_items when items is NIL.
author Fred Pierresteguy <F.Pierresteguy@frcl.bull.fr>
date Wed, 23 Mar 1994 18:23:32 +0000
parents c6cafb1168b3
children 91112dd5c9f5
files src/xmenu.c
diffstat 1 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xmenu.c	Wed Mar 23 18:22:13 1994 +0000
+++ b/src/xmenu.c	Wed Mar 23 18:23:32 1994 +0000
@@ -1093,7 +1093,7 @@
 extern void EmacsFrameSetCharSize ();
 
 static void
-update_one_frame_psheets (f)
+update_frame_menubar (f)
      FRAME_PTR f;
 {
   struct x_display *x = f->display.x;
@@ -1162,7 +1162,8 @@
   wv->enabled = 1;
   save_wv = first_wv = wv;
 
-  items = FRAME_MENU_BAR_ITEMS (f);
+  if (NILP (items = FRAME_MENU_BAR_ITEMS (f)))
+    items = FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
 
   for (i = 0; i < XVECTOR (items)->size; i += 3)
     {
@@ -1202,7 +1203,7 @@
   
   free_menubar_widget_value_tree (first_wv);
 
-  update_one_frame_psheets (f);
+  update_frame_menubar (f);
 
   UNBLOCK_INPUT;
 }
@@ -1224,6 +1225,16 @@
       UNBLOCK_INPUT;
     }
 }
+/* Called from Fx_create_frame to create the inital menubar of a frame
+   before it is mapped, so that the window is mapped with the menubar already
+   there instead of us tacking it on later and thrashing the window after it
+   is visible.  */
+void
+initialize_frame_menubar (f)
+     FRAME_PTR f;
+{
+  set_frame_menubar (f);
+}
 
 /* Nonzero if position X, Y relative to inside of frame F
    is in some other menu bar item.  */