SYNOPSIS

DESCRIPTION

This widget is derived from Tk::Entry. It implements an other kind of tooltip, that is displayed inside the entry when it's empty. The tooltip will be removed, if the entry gets the focus and reinserted, if the entry loses the focus and it's value is empty ($entry->get() eq '').

In addition, the entry evaluates the escape-key. If the entry has the focus and the escape-key is pressed, the original input will be restored. If there is no previous input, the tooltip will be displayed again.

OPTIONS

Any option exept the -tip will be passed to the construktor of the Tk::Entry. The -text option is altered minimally.

-tip (new option)

Specify the tooltip, that will be displayed.

The default value is 'Search...'.

-text (altered option)

If there is no -text attribute for the Entry, the tooltip will be set initially as default text. Specify -text if you want another initial input.

The default value is the same as for -tip.

METHODS

ClassInit( $class, $mw )

Bind FocusIn, FocusOut and Escape to events.

Populate( \%args )

This method is part of the underlying Tk inheritance mechanisms. You the programmer do not necessarily even need to know it exists; we document it here only to satisfy Pod coverage tests.

Sets default for -tip, unless specified. Set -text initially to -tip, if there is -tip, but no -text.

FocusIn()

When the entry gets the focus, the tooltip will be removed.

FocusOut()

When the entry loses the focus and if it's empty, the tooltip will be inserted.

Escape()

If the escape key is pressed, the current input will be discarded. The previous input will be inserted. If there is no previous input, the -tip will be the new input.

SEE ALSO

CREDITS

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.2 or, at your option, any later version of Perl 5 you may have available.