[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] key event handler in dialogs



At 13.03 1998.04.30, Erik Ferlanti wrote:
>I've been using a slightly modified version of Alan's method which works great
>except for one problem. When I hit the tab key, it appears that focus moves
>into the visible text field and then all characters typed are visible and the
>dialog returns nothing. Is there a way to mess with the tab control in the
>dialog box or can you set a hook to catch just the tab key??

You can catch a tab like so:

  $dlg->sethook(key   => sub {$_[1] == 9 ? 1 : 0});

This will effectively say "I've already handled the tab key".  But then you
have to handle the text by yourself instead of allowing it to go right into
the text box.  I haven't quite figured it all out yet.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch