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

I thought maybe somehow placing an entry widget on top of the tab, but I cannot seem to find a way to get the position of the tab. Do you know if the PERL/TK modules are better suited for this? Or would they be about the same?

Replies are listed 'Best First'.
Re^3: Tkx Notebook Tabs
by Anonymous Monk on Aug 14, 2010 at 00:22 UTC
    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
      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