Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: advanced perl tk widget than notebook

by ghosh123 (Monk)
on May 31, 2013 at 11:30 UTC ( [id://1036231]=note: print w/replies, xml ) Need Help??


in reply to Re: advanced perl tk widget than notebook
in thread advanced perl tk widget than notebook

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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1036231]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-23 10:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found