I was used to get a wxMenu object while applying the GetEventObject()
method to the object passed to the menu event handler. But now I got a
MainWindow object. I'm now unable to retrieve information about what
menu item was chosen by getting the label of the item clicked.
I run FreeBSD, bit I tried on a Linux box and the same problem raised.
I was used to get a wxMenu object while applying the GetEventObject()
method to the object passed to the menu event handler. But now I got a
MainWindow object.
Yes, wxGTK was inconsistent with the other platforms there and so it was changed to be the same as the rest.
I'm now unable to retrieve information about what
menu item was chosen by getting the label of the item clicked.
event.GetId() should return the ID of the menu item that was selected. If you don't want to track the IDs then you should be able to get to the menu item using the ID, something like this:
I found in the wxPython Demo of wxStyledTextCtrl_1 (in the source
code header provided in lieu of docs) where wxSTC_CMD_TAB and
wxSTC_CMD_BACKTAB get bound to specific integers (2327 and 2328
respectively).
However in the demo of wxStyledTextCtrl_2, on the Windows platform
(XP wxPython 2.4.1.2 running on Python 2.3) where Python code
shows as an example, Shift+Tab doesn't accomplish a dedent of a
highlighted text block. Is this supposed to work? Indent works
as expected (highlight code block, hit Tab).
I notice Shift+Tab has the effect of moving me from frame to frame
within the demo (is this a standard key binding for wx as a whole?),
which leads me to suspect it's standard behavior within a program
editor has been commandeered. I don't know how it works in full
Scintilla, but I'd guess Shift+Tab works in there.
Shift+Tab is probably the only really logical key combo for dedenting
a block, as most keyboards have this little symbol etched into the
key which graphically depicts its expected behavior.
IIRC the problem is that the Shift-Tab is being trapped for a navigation key because there is a wxPanel (or other navigation sensitive class) in the heirarchy so the event is never getting to the wxSTC window. wxSTC uses the wxWANTS_CHARS style which lets through the Tab but not shift-Tab for some reason. Please enter a bug report about this.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!