The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Tk::Airports - A widget to select airports

SYNOPSIS

  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();

WIDGET-SPECIFIC OPTIONS

Name: selectMode
Class: SelectMode
Switch: -selectmode

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.

Name: font
Class: Font
Switch: -font

Specifies the font for the list of Airports. The default font is "Courier 8"

Name: title
Class: Title
Switch: -title

Specifies the title of the widget.

Name: order
Class: Order
Switch: -order

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.

Name: filename
Class: Filename
Switch: -filename

Specifies a file that contains a user specific set of Airports

DESCRIPTION

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.

WIDGET METHODS

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.

DEFAULT BINDINGS

The following additional behavior is defined by the default bindings:

[1]

Start the search via <Return> in the Entry at the top of the widget.

[2]

Return the selected values via <Return> in the listbox.

[3]

Return one selected value via double-clicking the entry in the listbox.

BUGS

Please contact me when you have found a bug.

ToDo

*) 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:

Accept
Cancel
Populate
Show

AUTHOR

Renee Baecker, <module@renee-baecker.de>

COPYRIGHT AND LICENSE

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