[wxruby-users] StaticText-only Notebook page eats tab key

David Peoples davidp at touringcyclist.com
Tue Mar 10 23:18:49 EDT 2009


On Tue, 2009-03-10 at 18:50 +0000, Alex Fenton wrote:
> Hi David
> 
> Thanks for the report and the example. I get the same thing on GTK. I 
> spent a little time with it but couldn't get to the bottom of what's 
> happening here. As point 6, second list here says, tab traversal is 
> platform dependent:
> 
> http://www.wxwidgets.org/docs/technote/wxaccesstips.htm
> 
> So I'm not sure whether this is a wxWidgets bug, or a problem for Gtk 
> apps in general which have a notebook pane containing no controls which 
> accepts focus (see Window#accepts_focus).
> 
> It's probably best to work around it by avoiding problematic layouts, or 
> you may be able to code around it by using various classes / events 
> related to focus and keyboard navigation (FocusEvent, ChildFocusEvent 
> and NavigationKeyEvent). NB FocusEvent#get_window is missing in 2.0.0 
> but fixed in SVN.
> 
> If you're able to get to figure it out, please do post a bug to the 
> wxWidgets tracker.
> 
> http://trac.wxwidgets.org/
> 
> a
> 

Alex,

Thanks for your help. I have one more observation / clue about this
problem.

I hooked up the ChildFocusEvent to report what has focus when the tab
sequence gets trapped, and my original guess (that the focus is going to
one of the controls on a hidden page) was wrong. The focus is going to
the Panel itself of the visible tab page. I don't understand C++ well
enough to make much of the wxWidgets code so I won't be the source of a
patch, but perhaps that clue can help someone else find the problem.

(I think I've seen evidence that the tab sequence won't jump from a set
of controls on one panel to the controls on another panel, just keeps
cycling through the first panel's set. If true, that might be related to
this issue. But I can't reproduce the demonstrating code, so maybe I
imagined that (or some other bug in my code caused it).

I'm working around the problem right now by using ListCtrls in report
mode to display the info that had been in the static text controls. It
is ugly but it works.

I'll think some more about using the ChildFocusEvent and
NavigationKeyEvent events to force the focus beyond the trap. My first
attempt kept getting stuck in a loop in shift-tab because of the
notebook's weird sequence when tabbing backwards. But I might have given
up too quickly.

David




More information about the wxruby-users mailing list