Leser: 9
choose( [ 0 .. 59 ], { max_cols => 10, alignment => 1, order => 0 } );
1
2
3
4
5
6
7
Choose:
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
choose( [ 0 .. 59 ], { max_cols => 10, alignment => 1, order => 0, indent/indentation/left_margin/? => 4 } );
1
2
3
4
5
6
7
Choose:
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
1
2
3
4
5
6
7
8
9
# Top Right Bottom Left (Anzahl Zeichen)
margin => "2,5,2,5"
#oder
margin => "2,5,2,5"
#oder
margin => [2,5,2,5]
#oder
margin => [ top => 2, right => 5, bottom => 2, left => 5 ]
# oder anders wie gewünscht
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/env perl use strict; use warnings; use 5.10.0; use Term::Choose::Screen qw( get_term_size ); use Term::Choose; my ( $width, $hight ) = get_term_size(); my $n = $width * $hight / 10; my $max_height = $hight - 8; my $list = [ map { sprintf "Hello_World__%0.3d", $_ } 1 .. $n ]; my $new = Term::Choose->new(); my $choice1 = $new->choose( $list, { prompt => "\n\n\nAAAAA:", max_height => $max_height, clear_screen => 1 } ); my $choice2 = $new->choose( $list, { prompt => "\n\n\nBBBBB:", max_height => $max_height, clear_screen => 0 } );