in reply to Re^3: A Perl Tk::NoteBook question
in thread A Perl Tk::NoteBook question


Hi Zentara,
Thank you for those two possible solutions. It took me sometime to go through your code as I'm new to Perl Tk. Although I haven't understood fully the Pixmap things in great detail, I'll try to check if there is any docs on it (the Tk docs on this is not detailed enough for newbie like me)

I think, it would have been much better if there was a way to add image (say a tick-mark) before the text string on the tab only when that page is raised and remove the image. But I realize that the 'add' and 'pageconfigure' methods in docs says that -image option is used only when -label is not specified.

Therefore I'll have to stick to the -background and -inactivebackground options (which you specified in this response)to aesthetically distinguish between the active page and the inactive ones.
Thanks again!

Replies are listed 'Best First'.
Re^5: A Perl Tk::NoteBook question
by zentara (Cardinal) on Jul 10, 2014 at 09:48 UTC
    I would look for finding a way to put an actual Label in the tab, then all you need to do is swap lables in and out. The Tk widgets are a simple toolkit, not designed for all the fancy stuff, like Gtk2 and Gtk3 are. Gtk will allow you to put Pango ( stylized text) into any Label, and I may be wrong, but you can add the Label to the tab.

    The -label option in Tk::NoteBook dosn't refer to an actual Label widget, but it would be nice if it did.


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

      Simple toolkit is good as my intention was more to learn a simple GUI in Perl and not worry too much about styles.
      I'm fine with Tk as it has been around for a long time and fulfills it's functions quite adequately (like you said in one your earlier posts: "in praise of poor old Tk").

      Anyway, I must again thank you for all your quick responses in this regard.