wx.MenuEvent

Inheritance diagram for wx.MenuEvent:



Description

This class is used for a variety of menu-related events. Note that these do not include menu command events, which are handled using wx.CommandEvent objects.

The default handler for wx.EVT_MENU_HIGHLIGHT displays help text in the first field of the status bar.

Derived From

Event Handling

Event Name Description
wx.EVT_MENU_OPEN(func) A menu is about to be opened. On Windows, this is only sent once for each navigation of the menubar (up until all menus have closed).
wx.EVT_MENU_CLOSE(func) A menu has been just closed.
wx.EVT_MENU_HIGHLIGHT(id, func) The menu item with the specified id has been highlighted: used to show help prompts in the status bar by wx.Frame
wx.EVT_MENU_HIGHLIGHT_ALL(func) A menu item has been highlighted, i.e. the currently selected menu item has changed.

Properties Summary

Class API

Methods

__init__(type=wx.wxEVT_NULL, winid=0, menu=None)

Constructor

Parameters:

  • type (eventtype)
  • winid (int)
  • menu (wx.Menu)

Returns:

wx.MenuEvent


GetMenu()

Returns the menu which is being opened or closed.

This method should only be used with the OPEN and CLOSE events and even for them the returned pointer may be None in some ports.


Returns:

wx.Menu


GetMenuId()

Returns the menu identifier associated with the event.

This method should be only used with the HIGHLIGHT events.


Returns:

int


IsPopup()

Returns True if the menu which is being opened or closed is a popup menu, False if it is a normal one.

This method should only be used with the OPEN and CLOSE events.


Returns:

bool


Properties

See GetMenu
See GetMenuId