menu
Entity: predicate

Usage:
menu(Type, Handle, Parent, Menu_func(_), Text)

Creates corresponding menu entry.

Type | Must be normal , checked , grayed , pop_up or separator .
Handle | handle. Use _ if you don't need it.
Parent | handle of the parent window. Use _ for default.
Menu_func(_) | predicate which will receive menu messages
Text | menu text

Example:

?-window( _, _, win_func(_), "menu demo", 100, 100, 200, 200).

win_func(init):-
menu(pop_up, _,_,mpopup(_),"Pop_up"),
menu(normal, _,_,mitem(_),"MenuItem").

mitem(press):-message("Message", "menuItem selected", i).

mpopup(init):-
menu(normal, _,_,s1(_),"SubItem1"),
menu(separator, _,_,fail(_),_),
menu(normal, _,_,s2(_),"SubItem2").

s1(press):-message("Message","SubItem1 selected", !).

s2(press):-message("Message","SubItem2 selected", n).

See also:

window