in reply to Re: Keyboard traversal for Tk::Notebook
in thread Keyboard traversal for Tk::Notebook

I'm using the underline option ...
... my $foo =$tab->add("FOO", -label => "Testing Tab", -underline => '0'); ...
But Alt-T doesn't bring the tab into focus with multiple tabs

Replies are listed 'Best First'.
Re: Re: Re: Keyboard traversal for Tk::Notebook
by jdtoronto (Prior) on Sep 12, 2003 at 16:12 UTC
    No it doesn't does it!

    I realised after I wrote that note that I wasn't using the bindings on the Notebook widget, and when I tried it, like you I found it doesn't work.

    I won't be able to get back to it for a few hours, but have a look at Tk::bind in your doc tree, that might give the answer.

    The section in the Tk::Notebook doc's is taken stright from the Tcl docs unchanged - and obviously does not apply!

    jdtoronto Updated:

    Check also the docs for Tk::autobind. It seems relevant, but I haven't had time to try coding anything yet. Good luck.

    john

      I appreciate the help,

      Thanks

Re: Re: Re: Keyboard traversal for Tk::Notebook
by menolly (Hermit) on Sep 12, 2003 at 20:16 UTC
    I haven't used Tk in several years, so I'm pulling this out of thin air, but...might passing a true value for -underline help?
Re: Re: Re: Keyboard traversal for Tk::Notebook
by ff (Hermit) on Oct 08, 2003 at 13:40 UTC
    I'm not familiar with Tk::Notebook and so the following may be way off:

    I believe you need to run 'bind' outside of the definition of your button. Using the 'underline' option literally only buys you the underlining of the '0'th position ('T') of the label. To actually make it DO something when you press <Alt-Key-T>, wouldn't you do something like the following in a statement outside of the 'my $foo' statement? ($tl is the toplevel widget where your widget lives)

    $tl->bind("<Alt-Key-T>", sub { $foo->invoke(); } );