in reply to advanced perl tk widget than notebook

You may want to look at "forget" and/or "destroy" for your page widgets.

For help you should show some code that does what you are hinting at instead of just trying to get monks to imagine what you might mean.

  • Comment on Re: advanced perl tk widget than notebook

Replies are listed 'Best First'.
Re^2: advanced perl tk widget than notebook
by ghosh123 (Monk) on May 31, 2013 at 11:30 UTC

    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;