A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://wxpython.org/Phoenix/docs/html/wx.ContextMenuEvent.html below:

wx.ContextMenuEvent — wxPython Phoenix 4.2.4a1 documentation

wx.ContextMenuEvent¶

This class is used for context menu events, sent to give the application a chance to show a context (popup) menu for a wx.Window.

Note that if wx.ContextMenuEvent.GetPosition returns 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 .

Notice that the exact sequence of mouse events is different across the platforms. For example, under MSW the context menu event is generated after EVT_RIGHT_UP event and only if it was not handled but under GTK the context menu event is generated after EVT_RIGHT_DOWN event. This is correct in the sense that it ensures that the context menu is shown according to the current platform UI conventions and also means that you must not handle (or call wx.Event.Skip in your handler if you do have one) neither right mouse down nor right mouse up event if you plan on handling EVT_CONTEXT_MENU event.

Events Emitted by this Class¶

Handlers bound for the following event types will receive a wx.ContextMenuEvent parameter.

Class Hierarchy¶

Inheritance diagram for class

ContextMenuEvent

:

Methods Summary¶

__init__

Constructor.

GetPosition

Returns the position in screen coordinates at which the menu should be shown.

SetPosition

Sets the position at which the menu should be shown.

Properties Summary¶ Class API¶
class wx.ContextMenuEvent(CommandEvent)¶

Possible constructors:

ContextMenuEvent(type=wxEVT_NULL, id=0, pos=DefaultPosition) -> None

This class is used for context menu events, sent to give the application a chance to show a context (popup) menu for a Window.


Methods¶
__init__(self, type=wxEVT_NULL, id=0, pos=DefaultPosition)¶

Constructor.

Parameters:
  • type (wx.EventType)

  • id (int)

  • pos (wx.Point)

Return type:

None


GetPosition(self)¶

Returns the position in screen coordinates at which the menu should be shown.

Use wx.Window.ScreenToClient to convert to client coordinates.

You can also omit a position from wx.Window.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 DefaultPosition.

Return type:

wx.Point


SetPosition(self, point)¶

Sets the position at which the menu should be shown.

Parameters:

point (wx.Point)

Return type:

None


Properties¶
Position¶

See GetPosition and SetPosition


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4