popup menu item event?

Is it possible to get a menu event when a submenu title is clicked, eg view or constraints?

In the attached image I want an event from a click on green shaded ‘view’ item. I can get events from all others. Clicking ‘view’ hides and shows the submenu alternately. I’ve tried binding mouse events to the item, but to no avail.

TIA

menu.png

brad@bradcan.homelinux.com wrote:

Is it possible to get a menu event when a submenu title is clicked, eg
view or constraints?

In the attached image I want an event from a click on green shaded
'view' item. I can get events from all others. Clicking 'view' hides
and shows the submenu alternately. I've tried binding mouse events to
the item, but to no avail.

This is what EVT_MENU_OPEN is for. You can do this:

self\.Bind\(wx\.EVT\_MENU\_OPEN, self\.menuOpen\)

That will get fired every time a menu or submenu is about to be opened.
You can query the event object to figure out which one it is.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Is it possible to get a menu event when a submenu title is clicked, eg view or constraints?

In the attached image I want an event from a click on green shaded ‘view’ item. I can get events from all others. Clicking ‘view’ hides and shows the submenu alternately. I’ve tried binding mouse events to the item, but to no avail.

TIA

···

On Thursday, June 14, 2018 at 1:52:02 PM UTC+1, br...@bradcan.homelinux.com wrote:

Yes EVT_MENU_OPEN for the sub menus works perfectly.

As Tim states the event occurs on the sub opening. So what I actually need is EVT_MENU_CLOSE which occurs as the item is left clicked.

Kudos for Tim Roberts

···

On Thursday, June 14, 2018 at 1:52:02 PM UTC+1, br...@bradcan.homelinux.com wrote:

Is it possible to get a menu event when a submenu title is clicked, eg view or constraints?

In the attached image I want an event from a click on green shaded ‘view’ item. I can get events from all others. Clicking ‘view’ hides and shows the submenu alternately. I’ve tried binding mouse events to the item, but to no avail.

TIA