$mw = MainWindow->new(-background => 'black'); $mw->geometry('+0+0'); $mw->title("My Display"); $f = $mw->Frame(-background => 'black')->pack; $f->Label(-text => 'PROJECTION', -foreground => 'white', -background => 'black')-> grid(-row => 1, -column => 1, -columnspan => 3, -sticky => 'w'); for ($i = 0; $i <= 5; $i++) { $f->Label(-text => $i, -foreground => 'white', -background => 'black')-> grid(-row => 1, -column => $i + 4, -sticky => 'nsew'); } $advisoryLabel = $f->Label(-textvariable => \$advisory, -foreground => $advisoryColor, -background => 'black')-> grid(-row => 2, -column => 1, -columnspan => 3, -sticky => 'w'); for ($i = 0; $i <= 5; $i++) { $JTALabel[$i] = $f->Label(-textvariable => \$JTA[$i + 1], -foreground => $JTAColor[$i + 1], -background => 'black')-> grid(-row => 2, -column => $i + 4, -sticky => 'nsew'); } $f->Label(-text => 'BREAKDOWN', -foreground => 'white', -background => 'black')->grid(-row => 3, -column => 1, -columnspan => 9, -sticky => 'nsew'); $f->Label(-text => 'ID', -foreground => 'white', -background => 'black')->grid(-row => 4, -column => 1, -sticky => 'w'); $f->Label(-text => 'TYPE', -foreground => 'white', -background => 'black')->grid(-row => 4, -column => 2, -sticky => 'w'); for ($i = 0; $i <= 5; $i++) { $f->Label(-text => $i, -foreground => 'white', -background => 'black')-> grid(-row => 4, -column => $i + 4, -sticky => 'nsew'); } foreach $name (keys %Domes) { $domeIndex = $Domes{$name}{dome}; $fRow = ($domeIndex * 2) + 6; $IDLabel[$domeIndex] = $f->Label(-text => $name, -foreground => 'green', -background => 'black')-> grid(-row => $fRow, -column => 1, -sticky => 'w'); $TypeLabel[$domeIndex] = $f->Label( -textvariable => \$Type[$domeIndex], -foreground => 'green', -background => 'black')-> grid(-row => $fRow, -column => 2, -sticky => 'w'); $f->Label(-text => 'PA:', -foreground => 'white', -background => 'black')-> grid(-row => $fRow, -column => 3, -sticky => 'w'); $f->Label(-text => 'RA:', -foreground => 'white', -background => 'black')-> grid(-row => $fRow + 1, -column => 3, -sticky => 'w'); for ($i = 0; $i <= 5; $i++) { $JABLabel[$domeIndex][0][$i] = $f->Label( -textvariable => \$JABText[$domeIndex][0][$i + 1], -foreground => 'green', -background => 'black')-> grid(-row => $fRow, -column => $i + 4, -sticky => 'nsew'); $JABLabel[$domeIndex][1][$i] = $f->Label( -textvariable => \$JABText[$domeIndex][1][$i + 1], -foreground => 'green', -background => 'black')-> grid(-row => $fRow + 1, -column => $i + 4, -sticky => 'nsew'); } } # create the menus $menuBar = $mw->Menu; $mw->configure(-menu => $menuBar); $file = $menuBar->cascade(-label => 'File', -tearoff => 0); $file->command(-label => 'New', -command => \&newDemo); $file->command(-label => 'Save Display', -command => \&saveDisplay); $file->separator; $file->command(-label => 'Quit', -command => \&closeWindow); $action = $menuBar->cascade(-label => 'Scenario', -tearoff => 0); $action->command(-label => 'Start Demo', -command => \&JTAMain); $action->command(-label => 'Stop Demo', -command => sub {$stopDemo = 1}); MainLoop(); sub saveDisplay { $image = $mw->Photo(-format => 'Window', -data => oct($JTADisplay->id)); $filename = 'myimage.jpg'; $image->write($filename, -format => 'JPEG'); }