Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Tk-Notebook tabs

by glenn (Scribe)
on Nov 14, 2014 at 19:46 UTC ( #1107241=perlquestion: print w/replies, xml ) Need Help??

glenn has asked for the wisdom of the Perl Monks concerning the following question:

So I'm trying to accomplish two things with a Tk::Notebook. First I would like to be able to change the order of the tabs. I have reviewed the source but I could not see a way to do it. Second I have a check box to enable/disable auto scrolling between all the tabs and while doing this I want any action taken within the notebook to set '$scroll' to 0. Thank you for your time.

use Tk; use Tk::Pane; use Tk::NoteBook; my $mainwindow = MainWindow->new(); my $controller_tabs; my $scroll = 0; $mainwindow->repeat(3000, sub { if ($scroll) { $controller_tabs->raise($controller_tabs->info("focusnext")); } }); $controller_tabs = $mainwindow->NoteBook(-dynamicgeometry=>1)->pack(-s +ide=>"top"); $mainwindow->Checkbutton(-text=>"Monitor Controllers", -variable=>\$sc +roll, -onvalue=>1, -offvalue=>0)->pack(-side=>"top"); for (my $x = 0; $x < 5; $x++) { $controller_tabs->add("tab$x", -label=>"tab$x"); } MainLoop();

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1107241]
Approved by Paladin
Front-paged by toolic
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2022-01-19 15:02 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (55 votes). Check out past polls.