#!/usr/bin/perl -w

use strict ;

use Tk ;
use Tk::ColourChooser ;

print STDERR <<__EOT__ ;
Simple test routine for Tk::ColourChooser.
Select a colour and click OK. The colour's name (or hex number if it has not
got a name) will be output in square brackets after this text. If you click
Transparent the output is [None]. If you click Cancel the program terminates.
__EOT__

my $Win = MainWindow->new ;

my $colour = 'white' ;
while( 1 ) {
    my $col_dialog = $Win->ColourChooser( -colour => $colour, ) ;
    $colour        = $col_dialog->Show ;
    print STDERR "[$colour]\n" ;
    exit unless $colour ;
}

MainLoop ;
