in reply to Re^2: Tkx Notebook Tabs
in thread Tkx Notebook Tabs

Tk::Notebook is the same as ttk_notebook, and AFAIK, it doesn't support that feature. As for getting the position of the tab, that should be possible

Replies are listed 'Best First'.
Re^4: Tkx Notebook Tabs
by conversecorollary (Novice) on Aug 14, 2010 at 01:25 UTC
    Any suggestestions?
      Any suggestestions?

      Just from looking at my Tk test scripts, you should look at Tk::DynaTabFrame or look at the script below, where you may be able to switch tab titles, by examing the following, and doing some juggling. :-)

      #!/usr/bin/perl use Tk; use Tk::NoteBook; use Tk::Photo; use Tk::Compound; use strict; my $mw=tkinit; my @tabs = qw/One Two Three/; my $nb=$mw->NoteBook( -font => "Arial 24", -background=>'lightgreen', -inactivebackground => "lightgray", -tabpadx => 5, -tabpady => 5, )->pack; my $c = $mw->Compound(-foreground=>'black',-bg=>'red',-showbackground= +>1); $c->Text(-text => "Four", -font => "Arial 24"); foreach my $title (@tabs){ $nb->add($title,-label=>$title); } $nb->add("Four",-image => $c); my $id = $mw->repeat(500,sub{&chgtab($tabs[3])}); $nb->bind('<ButtonRelease-1>', [\&killtimer,Ev('x'),Ev('y')]); MainLoop; sub killtimer{ my ($w,$x,$y) = @_; my $tab = $w->identify($x,$y); if ($tab eq "Four"){ $nb->pageconfigure($tab,-label=>$tab); $c->configure(showbackground=>0); $id->cancel; } } sub chgtab { $c->configure(-showbackground=>!$c->cget(-showbackground)); }

      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku
        Zentara, thanks. But it appears to me your solution is using the Tk interface rather than the Tkx, so my question is which do you like better and why? I did start with the Tk interface and moved to the Tkx because having the latest Tcl/Tk engines. Not to mention that the GUI had the themed widgets which of course looks more current on WINDOWS. But, I am beginning to re-think my decision... any advice?