Create a new Tk::AstroCatalog object. A new catalog object will be
created. Callbacks must be specified for -addCmd and -upDate; a warning is
issued for -onDestroy when it is missing.
$cat = new Tk::AstroCatalog($MW,
-addCmd => $addCmd,
-upDate => $upDate,
-onDestroy => $onDestroy);
Additionally a pre-existing Astro::Catalog object can be
supplied using the "-catalog" option.
$cat = new Tk::AstroCatalog($MW,
-addCmd => $addCmd,
-upDate => $upDate
-catalog => $cat);
The "-transient" option can be used if only a single
value is required from the widget. Default behaviour is for the widget
to be permanent. The "-transient" button does not have a
"Done" button on the screen (ie no button to close the window
without a selection)
The "-addCmd" callback is triggered whenever a
source is selected from the widget. If the widget is transient the
widget will be closed after the first add is triggered.
The "-onDestroy" callback is triggered when the
"Done" button is pressed.
The "-upDate" method is triggered whenever the
contents of the catalog widget are refreshed/updated.
It makes more sense for this widget to work like
Tk::FileSelect when used in transient mode since we want to get the
answer back rather than enter an event loop.
The "-customColumns" method can be used to add
additional columns to the display. This is an array of hashes specifying
the title, width and generator function for each column. This generating
function will be called with an Astro::Catalog::Item and must return a
string of the given width.
-customColumns => [{
title => 'Example',
width => 7,
generator => sub {
my $item = shift;
return sprintf('%7s', 'test');
}},
]