Tkx::FindBar - Perl Tkx extension for an incremental search toolbar


Tkx-FindBar documentation  | view source Contained in the Tkx-FindBar distribution.

Index


NAME

Top

Tkx::FindBar - Perl Tkx extension for an incremental search toolbar

SYNOPSIS

Top

   use Tkx;
   use Tkx::FindBar;

   my $mw      = Tkx::widget->new('.');
   my $text    = $mw->new_text();
   my $findbar = $mw->new_tkx_FindBar(-textwidget => $text);

   $text->g_pack();
   $findbar->g_pack();
   $findbar->hide();  # remove until requested by user

   # Bindings to display and hide toolbar and navigate matches.
   $findbar->add_bindings($mw,
      '<Control-f>'  => 'show',
      '<Escape>'     => 'hide',
      '<F3>'         => 'next',
      '<Control-F3>' => 'previous',
   );

   Tkx::MainLoop();

DESCRIPTION

Top

Tkx::FindBar is a Tkx megawidget that provides a toolbar for searching in a text widget. Using a toolbar for a search UI is much less obtrusive than a dialog box. The search is done incrementally (also known as "find as you type"). The toolbar may be hidden and shown as needed.

Tkx::FindBar was inspired by the great find toolbar in Mozilla Firefox.

WIDGET-SPECIFIC OPTIONS

Top

-textwidget => widget

Defines the widget to search in. This must be a text widget (or act like one).

-highlightcolor => color

Defines the background color used to highlight found text. The default value is #80FF80.

-tile

If set to 1 (the default) and the Tk tile package is available, the FindBar will be drawn using themed widgets to acheive a platform native appearance. If set to 0 or tiling is not available the standard widgets will be used instead.

METHODS

Top

hide

Hides the FindBar widget.

show

Shows the FindBar widget if hidden and focuses the entry subwidget.

first

Finds the first instance of the search text.

next

Finds the next instance of the search text. (Searches forwards.)

previous

Finds the previous instance of the search text. (Searches backwards.)

add_bindings

Shortcut method for bulk addition of bindings (e.g. to create keygboard shortcuts). The first argument is the widget to bind to. The remaining arguments are bind tag/method name pairs. Multiple tags may be bound to the same method.

LIMITATIONS

Top

The show and hide methods don't work with the place geometry manager. (The pack and grid geometry managers are supported.)

There's no support for configuring subwidgets.

BUGS

Top

Please report any bugs or feature requests to bug-tkx-findbar at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Tkx-FindBar. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Tkx::FindBar

You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Tkx-FindBar

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Tkx-FindBar

* CPAN Ratings

http://cpanratings.perl.org/d/Tkx-FindBar

* Search CPAN

http://search.cpan.org/dist/Tkx-FindBar

AUTHOR

Top

Michael J. Carman, <mjcarman at cpan.org>

COPYRIGHT AND LICENSE

Top


Tkx-FindBar documentation  | view source Contained in the Tkx-FindBar distribution.