#!/usr/local/bin/perl use Tk; use Tk::NoteBook; use Tk::DialogBox; use Tk::LabEntry; $mw = MainWindow->new(); $mw->title("TEST"); $mw->geometry( "400x300"); $mw->configure(-menu => my $menubar = $mw->Menu); my $file = $menubar->cascade(-label => '~File'); $file->command( -label => 'New Test', -underline => 0, -command => \&new_test, ); $file->separator; # ----------------------------------------------------------------------------------------------- ## Create the notebook and fill the whole window $nb = $mw->NoteBook()->pack(-expand => 1, -fill => 'both'); MainLoop; # Open new Single Test Run Tab subroutine sub new_test { # Popup for selecting name for new Tab $db = $mw->DialogBox(-title => "Select Test Name", -buttons => ["OK", "Cancel"]); $db->add('LabEntry', -textvariable => \$test_name, -width => 20, -label => 'Test Label:', -labelPack => [-side => 'left'])->pack; $db->Show( ); # Create the notebook and fill the whole window # Page 1 on the Notebook, with buttons on that page $p1 = $nb->add($test_name, -label => $test_name); $lbl_0 = $p1 -> Label(-text=>"$test_name Options:") -> place(-x => 0, -y => 100); $rdb_1 = $p1 -> Checkbutton(-text=>"Option1", -variable=>\$option1) -> place(-x => 100, -y => 100); $rdb_2 = $p1 -> Checkbutton(-text=>"Option2", -variable=>\$option2) -> place(-x => 100, -y => 120); $rdb_3 = $p1 -> Checkbutton(-text=>"Option3", -variable=>\$option3) -> place(-x => 100, -y => 140); }