in reply to Scrolling Lists

This code will keep your box as long as your longest value.
my @values = qw/ One Two Three Four Zoobdude(_Been_to_Dennys?_:) /; my $longest = 0; map { $longest = length > $longest ? length : $longest } @values; printf "<option value='$_'>%${longest}s\n", $_ foreach @values;
Update: You wanted to use CGI.pm? Ok, this time we'll use a fixed width of 40 chars:
my @values = qw/ One Two Three Four Zoobdude(_Been_to_Dennys?_:) /; my %popup; $popup{$_} = sprintf "%40s",$_ foreach @values; print $cgi->popup_menu( -name => 'popup', '-value' => [ keys %popup ], '-labels' => \%popup, ),"\n";
Enjoy!
--
Casey

Replies are listed 'Best First'.
RE: Re: Scrolling Lists
by drujax (Initiate) on Jul 20, 2000 at 23:23 UTC
    would this work if the scrolling list is empty?
      Honest answer: Beats me, try it!

      Guess: The first example wouldn't work, the second, I'm 95% sure.

      You man have to initialize the list to one blank element, ' ' for example.

      --
      Casey