#!/usr/local/bin/perl -w

# Demonstrate how to use Dialog to create and manipulate dialog objects.  lusol@Lehigh.EDU  95/01/16

require 5.001;
use Tk;
use Tk::Dialog;

$top = MainWindow->new;
$but = $top->Button(-text => 'Quit', -command => \&exit);
$but->pack;
$bitmaps = "$tk_library/demos/images";

$D1 = $top->Dialog('Dialog Example 1', '',  "\@${bitmaps}/noletters", '3', 'OK', '2', '3');
$D2 = $top->Dialog('Dialog Example 2', 'Frogs lacking lipophores are blue!', '', 'OK', "OK");

$D1->configure('Message', -wraplength=> '6i', -justify => 'right', -text => 'Crest has been shown to be an effective ' .
	       'decay-preventive dentifrice that can be of significant value when used in a conscientiously applied program ' .
	       'of oral hygiene and regular professional care.');
print "Selected button = ", $D1->show, ".\n";

$D2->show('-global');

$D2->configure('Message', -text => 'Change message text.');
$D2->show;
$D2->configure('Message', -text => 'New font.', -font => 'helvr30');
$D2->show;
$D2->configure('Message', -text => 'New color.', -foreground => 'cyan');
$D2->show;

$D2->configure('Message', -text => 'New bitmap and background color.');
$D2->configure('Bitmap', -bitmap => "\@$bitmaps/flagup");
$D2->configure('Bitmap', -background => 'red');
show $D2;

$D2->configure('Bitmap', -bitmap => '');
$D2->configure('Message', -text => 'Now remove the bitmap ...', -wraplength => '3i');
$D2->show;

$D2->configure('Bitmap', -bitmap => "\@$bitmaps/flagdown");
$D2->configure('Message', -text => 'and restore Flagdown!', -justify => 'center');
$D2->show;

MainLoop;
