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

use Tk;
require Tk::Toplevel;
use Tk::LabEntry;


### Set up the rest of the app and go.

$top = new MainWindow;

$MainFrame = $top->Frame->pack();
$first_name="Joe";

sub change_first_name {
	print "I'm here in change_first_name\n";
	$first_name = "Victoria";
#	update;
}

my(@DefLabelConfigs) = (-labelAnchor => 'e',  # Default lable configs.
	-width => 35,    # Default entry configs.
	-labelPack => [-side => 'left'],
	-labelWidth => 25,
);

$first_nameLabel = $MainFrame->LabEntry(
	-label => 'First name: ', 
	-textvariable => \$first_name, 
	@DefLabelConfigs);

# $first_nameLabel->configure(-label_anchor => 'e');
print "$@" if $@;

$first_nameLabel->Subwidget('label')->configure("-foreground", "blue");

$first_nameLabel->pack(-side => 'top');


$button = $MainFrame->Button(-text => 'Press Me',
	-command => sub { change_first_name; },
	)->pack(-side => 'bottom');


MainLoop;

