Without a working code snippet, it is hard for me to divine what you really are trying to do......but I think you are looking for a way to switch array references in the optionmenu. Look at this example, and see if it yields a clue, all you need to do is figure out that AoAoA structure, and manipulate it. Also see Setting options in Tk::Optionmenu without the callback?
#!/usr/bin/perl =head1 In article <1177961957.521777.74770@l77g2000hsb.googlegroups.com>, ken +@shail.co.uk says... > I am using an optionMenu to select the native language. > I therefore need to have the text in the -option array/list change > when it has been used to select a new language. > For example if "German" is selected that needs to change to "Deutch" +. > Only the original array gets used. > I have tried using a scalar to house the option array reference and > then pointing it to a new array for the new language but the origina +l > reference seems to be retained. Does the following do what you want? =cut use strict; use warnings; use Tk; my $reconfiguring; my %configuration = ( language => 0, ); my $mw = tkinit; my @languages = ( [[English => 0], [German => 1], [French => 2]], [[Englisch => 0], [Deutch => 1], [Franzoesisch => 2]], [[Anglais => 0], [Allemand => 1], [Francais => 2]], ); my $om = $mw->Optionmenu( -variable => \$configuration{language}, -options => $languages[$configuration{language}], )->pack; $om->configure(-command => sub{reconfigure($_[0])}); MainLoop; sub reconfigure { my($language) = @_; if (! $reconfiguring) { $reconfiguring = 1; $om->configure(-options => $languages[$language]); $reconfiguring = 0; } } __END__

I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re: TK Native Option Menu - Options Update Problems by zentara
in thread TK Native Option Menu - Options Update Problems by merrymonk

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.