Nick Ing-Simmons

From Jongbhak.com

Jump to: navigation, search

J . H . P <jong@[...].uk>  writes:
>
> $t->bind('<KeyPress>', \&update_line_number_variable);
> $t->bind('<Button>', \&update_line_number_variable);
>
> into one. Like
>
> $t->bind('<KeyPress> or <Button>', \&update_line_number_variable);
>
> What is the most elegant way if it is possible?

It is not possible. You could do it in a loop:

foreach my $event (qw(<KeyPress>  <Button>))
{
  $t-> bind($event, \&update_line_number_variable);
}

If you are reinventing a text editor you should be aware that
Tk800.015 will have some extras TextUndo and an editor with
line number display from Greg Bartles.

And please try and avoid sending HTML to mailing list - it just gets
in the way.

--
Nick Ing-Simmons <nik@[...].com>
Via, but not speaking for: Texas Instruments Ltd.

Personal tools