Tk::Airports - A widget to select airports
use Tk; use Tk::Airports; my $mw = MainWindow->new(); $airport = $mw->Airports(-title => 'AirportsWoldWide'); my @return_values = $airport->Show(); # or as one string my $return_value = $airport->Show();
Specifies one of several styles for manipulating the selection. The value of the option may be arbitrary, but the default bindings expect it to be either single, multiple or extended; the default value is single.
Specifies the font for the list of Airports. The default font is "Courier 8"
Specifies the title of the widget.
It is possible to change the order. The list can be ordered by Airport-Code (code) or by City-Name (city). The default value is code.
Specifies a file that contains a user specific set of Airports
The Airports method creates a new window and shows a list of nearly all airports. The widget provides several functions:
Search for an airport with the entry at the top of the widget.
The return values are the codes for the airports. In list context a list with one code per element is returned, in scalar context a string is returned with "; " as delimiter.
The Airports method creates a widget object. This object supports the configure and cget methods described in Tk::options which can be used to enquire and modify the options described above. The widget also inherits all the methods provided by the generic Tk::Widget class.
The following additional behavior is defined by the default bindings:
Start the search via <Return> in the Entry at the top of the widget.
Return the selected values via <Return> in the listbox.
Return one selected value via double-clicking the entry in the listbox.
Please contact me when you have found a bug.
*) translation of cities into national names *) allow other fonts *) option for specifying the return values (code,city,all) *) option for specifying the delimiter
document these methods:
Renee Baecker, <module@renee-baecker.de>
Copyright (C) 2006 - 2009 by Renee Baecker
This library is free software; you can redistribute it and/or modify it under the terms of Artistic License 2.0
To install Tk::Airports, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::Airports
CPAN shell
perl -MCPAN -e shell install Tk::Airports
For more information on module installation, please visit the detailed CPAN module installation guide.