I am giving this code as example. Just consider that I will passing the number of pages I want in the notebook as command line argument.
In this example, I am creating 3 pages by a foreach loop. How can I close any of them and again add one more according to my need.
my $mw = MainWindow->new;
my $noteframe = $mw->Frame();
my $book = $noteframe->NoteBook()->grid(-sticky=>'nsew')->pack(-expand
+ => 1, -fill => 'both');
my $page;
foreach my $i (1 .. 3)
{
my $page = $book->add("$i", -label => "page_$i");
my $text = $page->Scrolled('Text',
-scrollbars => 'e',
-background => #efefef'
)->pack(-fill => 'both', -expand=>1);
$text->insert('end', "this is page $i");
}
$noteframe->pack(-expand => 1, -fill => 'both', -side => 'top');
MainLoop;