in reply to re-binding Tab in a TK Text field

As you have found, Tab is special inside Tk::Text and your binding is not being trapped in time. I don't know why the explicit bind is not working. Mastering Perl/Tk mentions that the usual Tab focus method has been remapped to Shift-Tab for Tk::Text, so you might just use that.

A more involved possibility is to derive a new subclass from Tk::Text that doesn't remap Tab. Look at Tk::ROText for an example of subclassing. It is probably just a matter of overriding a single method.

-Mark

Replies are listed 'Best First'.
Re^2: re-binding Tab in a TK Text field
by pg (Canon) on Oct 29, 2004 at 18:02 UTC

    I tested, and it was actually remapped to both CTRL-TAB and SHIFT-TAB.

    But I really hate the fact that it was remapped to SHIFT-TAB, as everybody knows that, TAB goes to the next field, and SHIFT-TAB goes back to previous field. Tk has no reason to break that convention.

      As a workaround, chop the last character off the text field variable in the exit field binding method.
      the hardest line to type correctly is: stty erase ^H
Re^2: re-binding Tab in a TK Text field
by wolfger (Deacon) on Oct 29, 2004 at 17:44 UTC
    Actually, the normal Tab funciton is mapped to Ctrl-Tab, not Shift-Tab. At least, for Win32. I haven't tried it at home on Linux yet. Shift-Tab is normal Shift-Tab behaviour (backwards tabbing).

    Thanks for the pointer on subclassing. I'll check it out.

    --
    Believe nothing, no matter where you read it, or who said it - even if I have said it - unless it agrees with your own reason and your own common sense.
    (Buddha)