a definition; actually, the \"definition\" in such a key binding looks like\n\
\(STRING . REAL-DEFINITION). To give the menu a title, put a string into\n\
the keymap as a top-level element.\n\n\
+If REAL-DEFINITION is nil, that puts a nonselectable string in the menu.\n\
+Otherwise, REAL-DEFINITION should be a valid key binding definition.\n\
+\n\
You can also use a list of keymaps as MENU.\n\
Then each keymap makes a separate pane.\n\
When MENU is a keymap or a list of keymaps, the return value\n\
is a list of events.\n\n\
+\n\
Alternatively, you can specify a menu of multiple panes\n\
with a list of the form (TITLE PANE1 PANE2...),\n\
where each pane is a list of form (TITLE ITEM1 ITEM2...).\n\
CHECK_LIVE_WINDOW (window, 0);
f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
- xpos = (FONT_WIDTH (f->output_data.x->font) * XWINDOW (window)->left);
- ypos = (f->output_data.x->line_height * XWINDOW (window)->top);
+ xpos = (FONT_WIDTH (f->output_data.x->font)
+ * XFASTINT (XWINDOW (window)->left));
+ ypos = (f->output_data.x->line_height
+ * XFASTINT (XWINDOW (window)->top));
}
else
/* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
= (Lisp_Object *) alloca (previous_menu_items_used
* sizeof (Lisp_Object));
+ /* If we are making a new widget, its contents are empty,
+ do always reinitialize them. */
+ if (! menubar_widget)
+ previous_menu_items_used = 0;
+
buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
specbind (Qinhibit_quit, Qt);
/* Don't let the debugger step into this code
for (i = 0; i < previous_menu_items_used; i++)
if (menu_items_used == i
- || (previous_items[i] != XVECTOR (menu_items)->contents[i]))
+ || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i])))
break;
if (i == menu_items_used && i == previous_menu_items_used && i != 0)
{
int id;
menubar_widget = f->output_data.x->menubar_widget;
+
+ f->output_data.x->menubar_height = 0;
if (menubar_widget)
{
j++;
continue;
}
- width = XSTRING (item)->size;
+ width = XSTRING (item)->size_byte;
if (width > maxwidth)
maxwidth = width;
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
if (!NILP (descrip))
{
- int gap = maxwidth - XSTRING (item_name)->size;
+ int gap = maxwidth - XSTRING (item_name)->size_byte;
#ifdef C_ALLOCA
Lisp_Object spacer;
spacer = Fmake_string (make_number (gap), make_number (' '));
to reduce gc needs. */
item_data
= (unsigned char *) alloca (maxwidth
- + XSTRING (descrip)->size + 1);
+ + XSTRING (descrip)->size_byte + 1);
bcopy (XSTRING (item_name)->data, item_data,
- XSTRING (item_name)->size);
+ XSTRING (item_name)->size_byte);
for (j = XSTRING (item_name)->size; j < maxwidth; j++)
item_data[j] = ' ';
bcopy (XSTRING (descrip)->data, item_data + j,
- XSTRING (descrip)->size);
- item_data[j + XSTRING (descrip)->size] = 0;
+ XSTRING (descrip)->size_byte);
+ item_data[j + XSTRING (descrip)->size_byte] = 0;
#endif
}
else