******************* wx.ContextMenuEvent ******************* Inheritance diagram for `wx.ContextMenuEvent`: | .. inheritance-diagram:: wx.ContextMenuEvent | Description =========== This class is used for context menu events, sent to give the application a chance to show a context (popup) menu. When a keyboard context menu button is pressed on Windows, a right-click event with default position is sent first, and if this event is not processed, the context menu event is sent. So if you process mouse events and you find your context menu event handler is not being called, you could call `event.Skip` for mouse right-down events. .. note:: Note that if `GetPosition <#GetPosition>`_ returns `wx.DefaultPosition`, this means that the event originated from a keyboard context button event, and you should compute a suitable position yourself, for example by calling `wx.GetMousePosition <../wxFunctions.html#GetMousePosition>`_ . Derived From ^^^^^^^^^^^^^ * `wx.CommandEvent `_ * `wx.Event `_ * `wx.Object <../Widgets/wx.Object.html>`_ Event Handling ^^^^^^^^^^^^^^ ================================================== ================================================== Event Name Description ================================================== ================================================== wx.EVT_CONTEXT_MENU(id, func) A right click (or other context menu command depending on platform) has been detected. ================================================== ================================================== Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `GetPosition <#GetPosition>`_ * `SetPosition <#SetPosition>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Position <#Position>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(type=wx.wxEVT_NULL, winid=0, pt=wx.DefaultPosition) Constructor. **Parameters:** * `type` (eventtype) * `winid` (int) * `pt` (`wx.Point <../Widgets/wx.Point.html>`_) | **Returns:** `wx.ContextMenuEvent `_ -------- .. method:: GetPosition() Returns the position in screen coordinates at which the menu should be shown. Use `wx.Window.ScreenToClient <../Widgets/wx.Window.html#ScreenToClient>`_ to convert to client coordinates. You can also omit a position from `wx.Window.PopupMenu <../Widgets/wx.Window.html#PopupMenu>`_ in order to use the current mouse pointer position. If the event originated from a keyboard event, the value returned from this function will be `wx.DefaultPosition`. | **Returns:** `wx.Point <../Widgets/wx.Point.html>`_ -------- .. method:: SetPosition(point) Sets the position at which the menu should be shown. **Parameters:** * `point` (`wx.Point <../Widgets/wx.Point.html>`_) -------- Properties ^^^^^^^^^^ .. attribute:: Position See `GetPosition <#GetPosition>`_ and `SetPosition <#SetPosition>`_