#!/usr/local/bin/perl
use strict;
use warnings;
use Tk;
require Tk::BrowseEntry;
#########################
#Hitting the button casuses many instances of listBrowse widget
########################
my $main= MainWindow->new();
my $listButton=$main->Button(
-text=> 'list',
-height=> 2,
-width=> 10,
-relief=> 'ridge',
-command=> \&listBrowse,
)->pack();
my $choice="number"; #the default list item.
sub listBrowse{
my $listTag=$main->BrowseEntry(
-variable=>\$choice,
-browsecmd=>\&Verify
)->pack();
$listTag->insert("end","Number");
$listTag->insert("end","Bullet");
}
MainLoop;
####
#the steps in the refresh were to enable a disabled widget and destroy a created #widget, these two behaviors can be kept under a button to work simultaneously
$listButton->configure(-state=>'normal');
$listTag->destroy if Tk::Exists($listTag);
####