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

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

Replies are listed 'Best First'.
Re^6: Tkx Notebook Tabs
by conversecorollary (Novice) on Aug 14, 2010 at 20:07 UTC
    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?
      Yes, but maybe you can use the method in the Tk interface, to do the equivalent procedure in Tkx. Tkx is supported by ActiveState, and for that reason, it may be better, with better docs, etc. Have you asked on the Tkx maillist or forums?

      If I had to choose only 1 toolkit now, it would probably be Gtk2. It works on both win32 and linux, and has a good underlying design.

      See Re: Changing the geometry placement of Tk::Notebook tabs for an example of Gtk2::Notebook


      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku