in reply to perl/Tk Entry updating

In addition to the textvariable problem which has been pointed out, what you need to do is add a -browsecmd to make your program work.
#!/usr/bin/perl use strict; use Tk; use Tk::BrowseEntry; my $AssignMet='\Input\0InputMeteo.txt'; my $AssignTmy='\Input\TMY2\FR-Trappes-71450.tm2'; my $type='Site'; my $simuTl = new MainWindow(); my $f0 = $simuTl->Frame(); my $l="Type de fichier m\xE9t\xE9o"; my $lb0 = $f0->BrowseEntry( -label => $l, -choices => ['Site','TMY2'], -variable => \$type, -browsecmd => \&detect , )->pack(); $f0->pack(); my $f1 = $simuTl->Frame(); my $l="Fichier de donn\xE9es m\xE9t\xE9o"; my $lab1 = $f1->Label( -text => $l, ); my $ent1; if ($type eq "Site") { $ent1 = $f1->Entry(-text => $AssignMet); $lab1->pack(-side => 'left'); $ent1->pack(); $f1->pack(); } else { $ent1 = $f1->Entry(-text => $AssignTmy); $lab1->pack(-side => 'left'); $ent1->pack(); $f1->pack(); } MainLoop; sub detect{ if ($type eq "Site") { $ent1-> configure (-text => $AssignMet); } else { $ent1->configure(-text => $AssignTmy); } }
As an oddity, I did find that your erroneous use of textvariable did work. This is somewhat bad programming, so I show the code here in the READMORE. Do not expect this switching of textvariable to be reliable, but somehow it works.
#!/usr/bin/perl use strict; use Tk; use Tk::BrowseEntry; my $AssignMet='\Input\0InputMeteo.txt'; my $AssignTmy='\Input\TMY2\FR-Trappes-71450.tm2'; my $type='Site'; my $simuTl = new MainWindow(); my $f0 = $simuTl->Frame(); my $l="Type de fichier m\xE9t\xE9o"; my $lb0 = $f0->BrowseEntry( -label => $l, -choices => ['Site','TMY2'], -variable => \$type, -browsecmd => \&detect , )->pack(); $f0->pack(); my $f1 = $simuTl->Frame(); my $l="Fichier de donn\xE9es m\xE9t\xE9o"; my $lab1 = $f1->Label( -text => $l, ); my $ent1; if ($type eq "Site") { $ent1 = $f1->Entry(-textvariable=>\$AssignMet); $lab1->pack(-side => 'left'); $ent1->pack(); $f1->pack(); } else { $ent1 = $f1->Entry(-textvariable=>\$AssignTmy); $lab1->pack(-side => 'left'); $ent1->pack(); $f1->pack(); } MainLoop; sub detect{ if ($type eq "Site") { $ent1-> configure (-textvariable=>\$AssignMet); } else { $ent1->configure(-textvariable=>\$AssignTmy); } }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh