water has asked for the wisdom of the Perl Monks concerning the following question:

Can anyone tell me how to turn off the little gray rectangle that appears next to the text inside an Optionmenu in TK?

That little graphic element makes the button too wide for our needs.

Thanks!

water

  • Comment on Tk optionmenu: remove little indicator thingy how?

Replies are listed 'Best First'.
Re: Tk optionmenu: remove little indicator thingy how?
by pg (Canon) on Oct 09, 2004 at 19:47 UTC

    Set indicatoron to false.

    use Tk; my $mw = MainWindow->new(); my $opt = $mw->Optionmenu( -options => [[jan=>1], [feb=>2], [mar=>3]] )->pack; $opt->configure(-indicatoron => undef); MainLoop;
      very cool, ++, thanks!

      i noticed you can't pass -indicatoron => undef in when creating the optionmenu; you have to do it subsequently with a configure.

      a TK oddity that doesn't make sense to me -- spoiled by perl dwiminess, I guess.

      Again, thanks!!

        It is true that you cannot pass in indicatoron parameter when you creating the optionmenu. That must be a bug ;-) Take care!