Menus

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 a wxEVT_COMMAND_MENU_SELECTED event, you should pass the pointer to the wxMenu parent of the wxMenuItem.

Use of the { wxFrame, wxMenu } parameter is deprecated, and should not be used on any platform.

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: MenuItem ID

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: Menu ID

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

Returns: True or false

Insert a wxMenuItem at position in the specified menu.


Menus

[func]
is_menuitem_checked
( atom menuitem )

Category: Menus

Returns: Checked state of the MenuItem

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_menuitem_bitmap
( atom item, atom bitmap )

Category: Menus


Menus

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

Category: Menus

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