ALEX::Search - megawidget for searching ALEX::DB indexes.
ALEX::Search - megawidget for searching ALEX::DB indexes.
use Tk;
use ALEX::Search;
use MARC::Record;
my $mw = MainWindow->new;
$mw->title("Search Test");
#
# The Search window
#
# connectstring: database to search
# limit : number of hits to return
# height : number of hits to display
# pre : start this many records before search string
#
my $wSearch = $mw->ALEX_Search(-connectstring => "calli_test",
-limit => 20,
-height => 10,
-pre => 5,
)->pack;
#
# Add a button-bar at the bottom
#
my $FRAME_ACTIONS = $mw->Frame()->pack(-side => 'bottom',
-expand => 1,
-fill => 'x');
#
# Add a button to get the selected record
#
$FRAME_ACTIONS->Button(-text => "Get",
-command => sub { my $marc = $wSearch->get();
# Do something with the record:
print $marc->title() if $marc;
})->pack(-side => 'left');
#
# Add a button to get the selected record id
#
$FRAME_ACTIONS->Button(-text => "Get ID",
-command => sub { my $ID = $wSearch->getID();
# Do something with the id:
print $ID if $ID;
})->pack(-side => 'left');
MainLoop;
This is a megawidget that allows searching of ALEX::DB object indexes.
The widget does not change the MARC::Record, it creates a new
MARC::Record when the get() routine is invoked.
Copyright 2004 by David Christensen
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
|