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();
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|