How to prevent Listbox from consuming Copy?

I’ve got a Listbox on a Window and even though there’s an EditCopy MenuHandler on the Window, the Listbox is consuming the copy and putting text on the pasteboard. The MenuHandler is not firing at all. While this is an easy shortcut for some uses, this destroys any kind of advanced copy functionality one may want to implement.

Xojo 2018r4
macOS 10.14.2 and 10.12.6

Has anyone worked around this behavior before?

[quote=420194:@Tim Parnell]I’ve got a Listbox on a Window and even though there’s an EditCopy MenuHandler on the Window, the Listbox is consuming the copy and putting text on the pasteboard. The MenuHandler is not firing at all. While this is an easy shortcut for some uses, this destroys any kind of advanced copy functionality one may want to implement.

Xojo 2018r4
macOS 10.14.2 and 10.12.6

Has anyone worked around this behavior before?[/quote]
Subclass the listbox and implement the menuhandlers there

if the cell is editable, the system (macos) installs a text copy-paste menu handler that bypasses any copy-paste menuhandler in the listbox.
then you have to put the menuhandler in the window to be handled correctly.

The Listbox is not what holds the data being copied. It has focus because none of the other controls on the view are able to get focus. I’m expecting that the MenuHandler would fire, do you think this is a bug?

The cell is not editable. You can try it out - create a brand new project, drag in a Listbox, add a few rows (no code!), and run. Edit>Copy is enabled and will copy the selected row. There is no MenuHandler on the Listbox - I may need to take Karen’s approach of subclassing the Listbox to see if I can force it to do nothing.

Update: Subclassing Listbox and adding a MenuHandler did not work. The Listbox still consumed the copy and put text on the pasteboard.

Update Part 2: Instead of trying to get the Listbox to do nothing and bubble the MenuHandler up, I was able to use the MenuHandler to raise a custom event. It’s a bit roundabout, but a working system.

Thanks for your help, @Karen Atkocius and @Jean-Yves Pochez !