context
popup menus<element id="input-field"> <input_field /> <config> <!-- ... --> </config> <context> <menu> <append_items> <items> <label type='theme_text'>Reset</label> </items> </append_items> <append_copy_cut_paste> <parent>input-field</parent> </append_copy_cut_paste> </menu> <shortcut type='theme_text'>Alt-I</shortcut> </context> </element>
All supported theme widgets have an optional
context
element that uses
create_popup_menu
() to create a
context popup menu.
Its
menu
element
generates the list layout
manager for the context popup menu. An
optional shortcut
contains a
keyboard x::w::shortcut
value.
An append_copy_cut_paste
in the popup menu
adds standard
“Copy”,
“Cut”, and
“Paste” menu items. Its
parent
should be its element's
id
.
The context popup automatically takes care of
update
()ing these menu items before the
popup gets shown. It is not necessary to add the code for that, like
for
“Copy”,
“Cut”, and
“Paste” in the main application menu.