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

Alex Fenton alex at pressure.to
Tue Mar 10 14:50:00 EDT 2009


Hi David

David Peoples wrote:
> I'm working on the keyboard interface for a small application. The app
> has several controls on a Panel. One of those controls is a Notebook
> with 4 pages, each of which is another panel. Three of the tab panels
> contain ListCtrls, the fourth has only StaticText controls.
>
>
>   
...
> The problem is with the fourth tab that has only StaticText controls. If
> that tab is visible, the tab progression stops once the notebook is
> reached. The focus goes to the tab itself like normal, then the next tab
> key entry makes the focus disappear, and further tab keystrokes do
> nothing.
>
> Sample code below demonstrates the problem. I hadn't noticed it in my
> real app, but in this sample it looks like the focus is going to one of
> the controls on the *other*, hidden page of the notebook, then getting
> stuck, presumably since that control is hidden and not supposed to
> accept keystrokes.

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



More information about the wxruby-users mailing list