Here is a way using the browsecommand method of the BrowseEntry and using a hash to store the values.
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::BrowseEntry; my $var; my $var1; my @fruits = qw( apple orange bananna grape); my @colors = qw( red orange green purple); my $widget1; # declare here so you can modify it # from first $widget my %options; $options{'Fruits'} = \@fruits; $options{'Colors'} = \@colors; #print "@{$options{'Fruits'}}\n"; my $mw = tkinit; my $widget = $mw->BrowseEntry( -label => 'Select the Journal Name:', -variable => \$var, -state => 'normal', -choices => [qw(Colors Fruits)], -browsecmd=>sub{ #print "@_\n"; my $selected = $_[1]; print "$selected\n"; $widget1->configure( -choices => $options{$var}, ); $mw->update; } )->pack( -side => 'top', -pady => '10', -anchor => 'w'); $widget1 = $mw->BrowseEntry( -label => 'Select:', -variable => \$var1, -state => 'normal', -choices => $options{$var}, #-width => 45 )->pack( -side => 'top', -pady => '10', -anchor => 'w'); MainLoop();

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

In reply to Re: Combo box linked with another combo box by zentara
in thread Combo box linked with another combo box by Selvakumar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.