SourceForge.net Menus

Menus

Menus
Using menus Using menus requires you to create at least three objects: wxMenuBar, wxMenu and wxMenuItem. The wxMenuBar is child to the wxFrame of your application. The wxMenuBar can have multiple wxMenu children, and each wxMenu can have multiple wxMenuItem children.

Menu Events:

When setting an event for a wxMenuItem under Linux, this must be a sequence where the first element is the wxFrame to which the wxMenuItem belongs, and the second element is the wxMenu to which the wxMenuItem belongs. Under Windows, set_event_hander() will also accept this as a sequence.
Functions/Procedures
Subtopics

Menus

[proc]
check_menuitem
( atom menuitem, integer check )

Category: Menus

If check is 0, then the menuitem is unchecked. If check is 1, then the menuitem is checked.


Menus

[proc]
enable_menuitem
( atom menuitem, integer enable )

Category: Menus

1 enables a menuitem, 0 disables.


Menus

[func]
get_menuevent_id
( atom event )

Category: Menus

Returns the id of the wxMenuItem that generated the event. This should only be called from within a wxEVT_COMMAND_MENU_SELECTED event procedure.


Menus

[func]
get_menuitem_id
( atom item )

Category: Menus

Returns the id for a wxMenuItem. Since wxMenuItem is not derived from wxWindow, you should never use get_id() with a wxMenuItem.


Menus

[func]
insert_menuitem
( atom menu, integer position, atom id, sequence text, sequence help, integer checkable )

Category: Menus

Insert a wxMenuItem at position in the specified menu.


Menus

[func]
is_menuitem_checked
( atom menuitem )

Category: Menus

Returns 1 if the menuitem is checked, 0 otherwise.


Menus

[proc]
remove_menuitem
( atom menu, atom item )

Category: Menus

Removes a wxMenuItem from a wxMenu and deletes the wxMenuItem.


Menus

[proc]
set_menu_label
( atom menu, atom id, sequence label )

Category: Menus

Use to change the text of a menu item. id should be the id of the menuitem.