menu
Entity: predicate

Usage:
menu( )
menu(Arg1, ... , ArgN)

Creates corresponding menu entry.

Put inside the brackets only these arguments which you need. All other arguments will be set by default. The arguments may be any of the following (the order is not important).
 
handle(Handle) handle to this menu entry. 
parent(Parent) handle to the parent window.
action(Menu_func) predicate which will receive messages from this menu entry.
text(Text) the menu entry text
normal, pop_up, separator  flags for the menu entry type.
checked, grayed, right  flags for the menu entry type.

Example:

?-window( title("menu demo") ).

win_func(init):-
  menu(pop_up, action(m_popup), text("Pop_up") ),
  menu(normal, action(m_item), text("MenuItem") ).

m_item(press):-message("Message", "menu item selected", i).

m_popup(init):-
  menu(normal, action(s1), text("SubItem1") ),
  menu(separator),
  menu(normal, action(s2), text("SubItem2") ).

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

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

See also:

window