Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jouke (587)


Jouke has been programming Perl since 1997 and started using Perl to write programs to make life and communication easier for disabled people early 2001. Take a look at his website [] for more information.

Journal of jouke (587)

Monday July 03, 2006
12:49 PM

Now this is something I didn't expect...

[ #30156 ]

This striked me as quite a surprise. A Wx::MenuItem and also a Wx::Menu is not a subclass of Wx::Window. This means you can't query a menu's position, nor its size. Since that's not possible, I can't draw a box around a selected menu item to indicate (for a switch user) that it's selected.

Quite a disappointment, and I have no clue whatsoever how to solve it. I've dug in the wxWidgets sources, and it uses the platform-specific calls to create window menus, so there's no easy way to get around this.

I'm afraid I'm left with only two choices: either code my own menus and replace the wxWidget's menus (which is not an appealing option), or I'll drop the accessibility of menus (not attractive either).

Suggestions welcome!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I'm not a Wx user myself, and I find the docs on CPAN pretty sparse... but I wonder if it is possible to use owner-drawn menus. All I could find for docs about those is for wxPython []. That shows that Wx knows the concept at least, on Windows.

    You don't really need the absolute position on the screen, all you need is a drawing area, AKA a canvas. That needn't have a known absolute position on the screen, as long as the underlying GUI library knows where to draw it.

    • Owner drawn is probably (I've looked at it, but can't say I grasp all of it yet) still the same as drawing your own menus. Which automatically means sacrificing the native OS look of your menus.

      What I need is a menu, and a menuitem that "owns" its position and size. The purpose of it all is to be able to draw a box around it on the screen to indicate what you're about to select (for the people who can't use a mouse, but use switches).
  • How about explaining the problem to WxWidgets people, in the form of an enhancement request?
    • Of course that is an option. However, I don't expect much of that, since it's an "enhancement" that is only useful in my specific situation. Why else would you want to know where a menu item exists on the screen?

      wxWidgets is of course a generic, platform independent GUI toolkit, being (in lots of cases) a wrapper around platform-specific calls. Menus are supported on all platforms, and therefore they call the platform-specific API to draw a menu somewhere. If the platform doesn't provide that information, t