Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
5b3557df
Commit
5b3557df
authored
Mar 03, 1994
by
Richard M. Stallman
Browse files
(map_event_to_object, set_frame_menubar):
Use FRAME_MENU_BAR_LINES as vector.
parent
16c323ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
src/xmenu.c
src/xmenu.c
+24
-7
No files found.
src/xmenu.c
View file @
5b3557df
...
...
@@ -793,6 +793,8 @@ event_is_in_menu_item (mw, event, name, string_w)
}
/* Return the menu bar key which corresponds to event EVENT in frame F. */
Lisp_Object
map_event_to_object
(
event
,
f
)
struct
input_event
*
event
;
...
...
@@ -812,11 +814,22 @@ map_event_to_object (event, f)
if
(
ws
&&
event_is_in_menu_item
(
mw
,
event
,
val
->
name
,
&
string_w
))
{
Lisp_Object
items
;
int
i
;
items
=
FRAME_MENU_BAR_ITEMS
(
f
);
for
(;
CONSP
(
items
);
items
=
XCONS
(
items
)
->
cdr
)
if
(
!
strcmp
(
val
->
name
,
XSTRING
(
Fcar
(
Fcdr
(
Fcar
(
items
))))
->
data
))
return
items
;
for
(
i
=
0
;
i
<
XVECTOR
(
items
)
->
size
;
i
+=
3
)
{
Lisp_Object
pos
,
string
,
item
;
item
=
XVECTOR
(
items
)
->
contents
[
i
];
string
=
XVECTOR
(
items
)
->
contents
[
i
+
1
];
pos
=
XVECTOR
(
items
)
->
contents
[
i
+
2
];
if
(
NILP
(
string
))
break
;
if
(
!
strcmp
(
val
->
name
,
XSTRING
(
string
)
->
data
))
return
item
;
}
}
}
return
Qnil
;
...
...
@@ -920,8 +933,9 @@ set_frame_menubar (f)
{
Widget
menubar_widget
=
f
->
display
.
x
->
menubar_widget
;
int
id
=
(
int
)
f
;
Lisp_Object
tail
;
Lisp_Object
tail
,
items
;
widget_value
*
wv
,
*
save_wv
,
*
first_wv
,
*
prev_wv
=
0
;
int
i
;
BLOCK_INPUT
;
...
...
@@ -931,12 +945,15 @@ set_frame_menubar (f)
wv
->
enabled
=
1
;
save_wv
=
first_wv
=
wv
;
items
=
FRAME_MENU_BAR_ITEMS
(
f
);
for
(
tail
=
FRAME_MENU_BAR_ITEMS
(
f
);
CONSP
(
tail
);
tail
=
XCONS
(
tail
)
->
cdr
)
for
(
i
=
0
;
i
<
XVECTOR
(
items
)
->
size
;
i
+=
3
)
{
Lisp_Object
string
;
string
=
Fcar
(
Fcdr
(
Fcar
(
tail
)));
string
=
XVECTOR
(
items
)
->
contents
[
i
+
1
];
if
(
NILP
(
string
))
break
;
wv
=
malloc_widget_value
();
if
(
prev_wv
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment