| 1 | #!/usr/local/bin/perl -s | ||
| 2 | |||
| 3 | eval 'exec /usr/bin/perl -s -S $0 ${1+"$@"}' | ||
| 4 | if 0; # not running under some shell | ||
| 5 | |||
| 6 | use lib '.'; | ||
| 7 | use Tk; #LOAD TK STUFF | ||
| 8 | use Tk::BrowseEntry; | ||
| 9 | use Tk::JBrowseEntry; | ||
| 10 | |||
| 11 | $MainWin = MainWindow->new; | ||
| 12 | |||
| 13 | $dbname1 = 'cows'; | ||
| 14 | $dbname2 = 'foxes'; | ||
| 15 | $dbname3 = 'goats'; | ||
| 16 | $dbname5 = 'default'; | ||
| 17 | |||
| 18 | $jb1 = $MainWin->JBrowseEntry( | ||
| 19 | -label => 'Normal:', | ||
| 20 | -variable => \$dbname1, | ||
| 21 | -state => 'normal', | ||
| 22 | # -arrowimage => $MainWin->Getimage('balArrow'), | ||
| 23 | -choices => [qw(pigs cows foxes goats cats)], | ||
| 24 | -width => 12); | ||
| 25 | $jb1->pack( | ||
| 26 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 27 | $jb2a = $MainWin->JBrowseEntry( | ||
| 28 | # -arrowimage => $MainWin->Getimage('balArrow'), | ||
| 29 | -label => 'Text:', | ||
| 30 | -variable => \$dbname2, | ||
| 31 | -state => 'text', | ||
| 32 | -choices => [qw(pigs cows foxes goats cats)], | ||
| 33 | -width => 12); | ||
| 34 | $jb2a->pack( | ||
| 35 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 36 | $jb2 = $MainWin->JBrowseEntry( | ||
| 37 | # -arrowimage => $MainWin->Getimage('balArrow'), | ||
| 38 | -label => 'TextOnly:', | ||
| 39 | -variable => \$dbname2, | ||
| 40 | -state => 'textonly', | ||
| 41 | -choices => [qw(pigs cows foxes goats cats)], | ||
| 42 | -width => 12); | ||
| 43 | $jb2->pack( | ||
| 44 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 45 | $jb3 = $MainWin->JBrowseEntry( | ||
| 46 | -label => 'ReadOnly:', | ||
| 47 | -variable => \$dbname3, | ||
| 48 | -choices => [qw(pigs cows foxes goats cats)], | ||
| 49 | -state => 'readonly', | ||
| 50 | -width => 12); | ||
| 51 | $jb3->pack( | ||
| 52 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 53 | $jb4 = $MainWin->JBrowseEntry( | ||
| 54 | -label => 'Disabled:', | ||
| 55 | -variable => \$dbname3, | ||
| 56 | -state => 'disabled', | ||
| 57 | -choices => [qw(pigs cows foxes goats cats)], | ||
| 58 | -width => 12); | ||
| 59 | $jb4->pack( | ||
| 60 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 61 | $jb5 = $MainWin->JBrowseEntry( | ||
| 62 | -label => 'Scrolled List:', | ||
| 63 | -width => 12, | ||
| 64 | -default => $dbname5, | ||
| 65 | -height => 4, | ||
| 66 | -variable => \$dbname5, | ||
| 67 | -browsecmd => sub {print "-browsecmd! (".join('|',@_).")\n";}, | ||
| 68 | -listcmd => sub {print "-listcmd! (".join('|',@_).")\n";}, | ||
| 69 | -state => 'normal', | ||
| 70 | -choices => [qw(pigs cows foxes goats horses sheep dogs cats ardvarks default)]); | ||
| 71 | $jb5->pack( | ||
| 72 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 73 | $jb6 = $MainWin->JBrowseEntry( | ||
| 74 | -label => 'Button Focus Also:', | ||
| 75 | -btntakesfocus => 1, | ||
| 76 | # -arrowimage => $MainWin->Getimage('balArrow'), | ||
| 77 | # -farrowimage => $MainWin->Getimage('cbxarrow'), | ||
| 78 | -width => 12, | ||
| 79 | -height => 4, | ||
| 80 | -variable => \$dbname6, | ||
| 81 | -browsecmd => sub {print "-browsecmd! (".join('|',@_).")\n";}, | ||
| 82 | -listcmd => sub {print "-listcmd! (".join('|',@_).")\n";}, | ||
| 83 | -state => 'normal', | ||
| 84 | #-borderwidth => 12, | ||
| 85 | #-framehighlightthickness => 6, | ||
| 86 | #-entryborderwidth => 8, | ||
| 87 | #-labelPack => [qw/-side top/], | ||
| 88 | -choices => [qw(pigs cows foxes goats horses sheep dogs cats ardvarks default)]); | ||
| 89 | $jb6->pack( | ||
| 90 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 91 | $jb8 = $MainWin->JBrowseEntry( | ||
| 92 | -label => 'Button Focus Only:', | ||
| 93 | -takefocus => 0, | ||
| 94 | -btntakesfocus => 1, | ||
| 95 | -width => 12, | ||
| 96 | -height => 4, | ||
| 97 | -variable => \$dbname6, | ||
| 98 | -browsecmd => sub {print "-browsecmd! (".join('|',@_).")\n";}, | ||
| 99 | -listcmd => sub {print "-listcmd! (".join('|',@_).")\n";}, | ||
| 100 | -state => 'normal', | ||
| 101 | -choices => [qw(pigs cows foxes goats horses sheep dogs cats ardvarks default)]); | ||
| 102 | $jb8->pack( | ||
| 103 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 104 | $jb7 = $MainWin->JBrowseEntry( | ||
| 105 | -label => 'Skip Focus:', | ||
| 106 | -takefocus => 0, | ||
| 107 | -btntakesfocus => 0, | ||
| 108 | -width => 12, | ||
| 109 | -height => 4, | ||
| 110 | -variable => \$dbname7, | ||
| 111 | -browsecmd => sub {print "-browsecmd! (".join('|',@_).")\n";}, | ||
| 112 | -listcmd => sub {print "-listcmd! (".join('|',@_).")\n";}, | ||
| 113 | -state => 'normal', | ||
| 114 | -choices => [qw(pigs cows foxes goats horses sheep dogs cats ardvarks default)]); | ||
| 115 | $jb7->pack( | ||
| 116 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 117 | |||
| 118 | $jb7->choices([qw(First Second Fifth Sixth)]); #REPLACE LIST CHOICES! | ||
| 119 | $jb7->insert(2, 'Third', 'Fourth'); #ADD MORE AFTER 1ST 2. | ||
| 120 | $jb7->insert('end', [qw(Seventh Oops Nineth)]); #ADD STILL MORE AT END. | ||
| 121 | $jb7->delete(7); #REMOVE ONE. | ||
| 122 | |||
| 123 | $jb9 = $MainWin->JBrowseEntry( | ||
| 124 | -label => 'Bouncy:', | ||
| 125 | -altbinding => 'list=bouncy', | ||
| 126 | -variable => \$dbname1, | ||
| 127 | -state => 'normal', | ||
| 128 | -choices => [qw(pigs cows foxes goats)], | ||
| 129 | -width => 12); | ||
| 130 | $jb9->pack( | ||
| 131 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 132 | |||
| 133 | $jb10 = $MainWin->JBrowseEntry( | ||
| 134 | -label => 'Fixed:', | ||
| 135 | -fixedlist => 'bottom', | ||
| 136 | -variable => \$dbname1, | ||
| 137 | -state => 'normal', | ||
| 138 | -choices => [qw(pigs cows foxes goats)], | ||
| 139 | -width => 12); | ||
| 140 | $jb10->pack( | ||
| 141 | -side => 'top', -pady => '10', -anchor => 'w'); | ||
| 142 | |||
| 143 | $b = $MainWin->Button(-text => 'Quit', -command => sub {exit (0); }); | ||
| 144 | $b->pack(-side => 'top'); | ||
| 145 | $jb1->focus; | ||
| 146 | |||
| 147 | MainLoop; |