comparison src/xmenu.c @ 30181:770a280db6ee

(menu_highlight_callback): Store help string in the `arg' member of the input event; don't cons. (menubar_selection_callback): Use the `arg' slot of input events to queue additional information, instead of consing.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 13 Jul 2000 14:08:48 +0000
parents 90534519c7b2
children 4e401f4a55aa
comparison
equal deleted inserted replaced
30180:c36d4c8b21b6 30181:770a280db6ee
1220 } 1220 }
1221 1221
1222 /* Store the help event. */ 1222 /* Store the help event. */
1223 help = wv && wv->help ? build_string (wv->help) : Qnil; 1223 help = wv && wv->help ? build_string (wv->help) : Qnil;
1224 buf.kind = HELP_EVENT; 1224 buf.kind = HELP_EVENT;
1225 buf.frame_or_window = Fcons (frame, help); 1225 buf.frame_or_window = frame;
1226 buf.arg = help;
1226 kbd_buffer_store_event (&buf); 1227 kbd_buffer_store_event (&buf);
1227 } 1228 }
1228 1229
1229 /* This callback is called from the menu bar pulldown menu 1230 /* This callback is called from the menu bar pulldown menu
1230 when the user makes a selection. 1231 when the user makes a selection.
1278 int j; 1279 int j;
1279 struct input_event buf; 1280 struct input_event buf;
1280 Lisp_Object frame; 1281 Lisp_Object frame;
1281 1282
1282 XSETFRAME (frame, f); 1283 XSETFRAME (frame, f);
1283 buf.kind = menu_bar_event; 1284 buf.kind = MENU_BAR_EVENT;
1284 buf.frame_or_window = Fcons (frame, Fcons (Qmenu_bar, Qnil)); 1285 buf.frame_or_window = frame;
1286 buf.arg = frame;
1285 kbd_buffer_store_event (&buf); 1287 kbd_buffer_store_event (&buf);
1286 1288
1287 for (j = 0; j < submenu_depth; j++) 1289 for (j = 0; j < submenu_depth; j++)
1288 if (!NILP (subprefix_stack[j])) 1290 if (!NILP (subprefix_stack[j]))
1289 { 1291 {
1290 buf.kind = menu_bar_event; 1292 buf.kind = MENU_BAR_EVENT;
1291 buf.frame_or_window = Fcons (frame, subprefix_stack[j]); 1293 buf.frame_or_window = frame;
1294 buf.arg = subprefix_stack[j];
1292 kbd_buffer_store_event (&buf); 1295 kbd_buffer_store_event (&buf);
1293 } 1296 }
1294 1297
1295 if (!NILP (prefix)) 1298 if (!NILP (prefix))
1296 { 1299 {
1297 buf.kind = menu_bar_event; 1300 buf.kind = MENU_BAR_EVENT;
1298 buf.frame_or_window = Fcons (frame, prefix); 1301 buf.frame_or_window = frame;
1302 buf.arg = prefix;
1299 kbd_buffer_store_event (&buf); 1303 kbd_buffer_store_event (&buf);
1300 } 1304 }
1301 1305
1302 buf.kind = menu_bar_event; 1306 buf.kind = MENU_BAR_EVENT;
1303 buf.frame_or_window = Fcons (frame, entry); 1307 buf.frame_or_window = frame;
1308 buf.arg = entry;
1304 kbd_buffer_store_event (&buf); 1309 kbd_buffer_store_event (&buf);
1305 1310
1306 return; 1311 return;
1307 } 1312 }
1308 i += MENU_ITEMS_ITEM_LENGTH; 1313 i += MENU_ITEMS_ITEM_LENGTH;