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();

In reply to Tk-Notebook tabs by glenn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.