|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
A menu is set by setting the value of the variable
current-menubar (which may be buffer-local) and then calling
set-menubar-dirty-flag to signal a change. This will cause the
menu to be redrawn at the next redisplay. The format of the data in
current-menubar is described in ‘menubar.c’.
Internally the data in current-menubar is parsed into a tree of
widget_value's (defined in ‘lwlib.h’); this is accomplished
by the recursive function
compute_menubar_data(). Such a tree is deallocated
update_screen_menubars() is one of the external entry points.
This checks to see, for each screen, if that screen’s menubar needs to
be updated. This is the case if
set-menubar-dirty-flagwas called since the last redisplay. (This function sets the C variable menubar_has_changed.)
set_screen_menubar() is called for each such screen. This
compute_menubar_data() to create the tree of
widget_value’s, then calls
to create the X-Toolkit widget associated with the menu.
update_psheets(), the other external entry point, actually
changes the menus being displayed. It uses the widgets fixed by
update_screen_menubars() and calls various X functions to ensure
that the menus are displayed properly.
The menubar widget is set up so that
called when the menu is first selected (i.e. mouse button goes down),
menubar_selection_callback() is called when an item is
pre_activate_callback() calls the function in
activate-menubar-hook, which can change the menubar (this is described
in ‘menubar.c’). If the menubar is changed,
set_screen_menubars() is called.
menubar_selection_callback() enqueues a menu event, putting in it
a function to call (either
its argument, which is the callback function or form given in the menu’s
|[ << ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.