My app uses accelerators for things like cut, copy, paste, etc.
Defined as '&Cut\tCtrl-C' etc. On Mac OSX (wxPython 2.8.4.0) these
global accelerators are triggered when editing text in a dialog
window, instead of the native cut, copy, paste functionality of the
TextCtrl. What's the best way to prevent this from happening? Should I
use an accelerator table for the mainwindow instead of the automatic
accelerators or are there other options?
My app uses accelerators for things like cut, copy, paste, etc.
Defined as '&Cut\tCtrl-C' etc. On Mac OSX (wxPython 2.8.4.0) these
global accelerators are triggered when editing text in a dialog
window, instead of the native cut, copy, paste functionality of the
TextCtrl. What's the best way to prevent this from happening? Should I
use an accelerator table for the mainwindow instead of the automatic
accelerators or are there other options?
IIRC there is something in the Apple HIG that requires that the main frame's Edit menu and the common clipboard menu items remain active even when modal dialogs are active, and so this is why it works this way in wxMac. However I've also seen the problem you describe but was never satisfied with the workarounds I tried. I had an idea a few days ago that I haven't had a chance yet to try... Does it work if you give the text widgets themselves an accelerator table? I know that the textctrl class already has EVT_MENU bindings for the standard clipboard IDs so it may just work with no other effort on your part, as long as they are able to get the menu events from the accelerators.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!