I see three choices, Tk::DynaTabFrame, Gtk2::Notebook, and roll your own on a canvas. Here is a Gtk2 Example
#! /usr/bin/perl -w use strict; use Gtk2 '-init'; use Glib qw/TRUE FALSE/; #standard window creation, placement, and signal connecting my $window = Gtk2::Window->new('toplevel'); $window->signal_connect('delete_event' => sub { Gtk2->main_quit; }); $window->set_border_width(5); $window->set_position('center_always'); #add and show the vbox $window->add(&ret_vbox); $window->show(); #our main event-loop Gtk2->main(); sub ret_vbox { my $vbox = Gtk2::VBox->new(FALSE,5); #create a instance of the Gtk2::Expander class my $expander = Gtk2::Expander->new_with_mnemonic('Expand Me'); #create the child that we want to add to it. #---------------------------------------------- #NOTE: If we want to resize #the widget containing the Gtk2::Expander Widget #to the size that it was BEFORE the expansion #we have to "add / remove" the child on each "expanded / closed" c +ycle #If we just add it, it will be shown and hidden, but we will not b +e able #to shrink the parent containing the Gtk2::Expander instance when +hidden #------------------------------------------------- my $nb = &ret_notebook; $nb->show_all; $expander->signal_connect_after('activate' => sub { if($expander->get_expanded){ $expander->set_label('Close Me'); $expander->add($nb); }else{ $expander->set_label('Expand Me'); $expander->remove($nb); $window->resize(4,4); } return FALSE; }); $vbox->pack_start($expander,FALSE,FALSE,0); $vbox->show_all(); return $vbox; } sub ret_notebook { #this will create a vbox containing a Notebook #and some widgets to manipulate the Notebook's #properties. my $vbox_nb = Gtk2::VBox->new(FALSE,5); $vbox_nb->set_size_request (500, 300); my $nb = Gtk2::Notebook->new; #pre-set some properties $nb->set_scrollable (TRUE); $nb->popup_enable; for (0..10) { my $child = Gtk2::Frame->new("Frame of Tab $_"); #________ #The tab's label can be a widget, and does not #need to be a label, here we create a hbox containing #a label and close button my $hbox = Gtk2::HBox->new(FALSE,0); $hbox->pack_start(Gtk2::Label->new("Tab $_"),FALSE,FALSE,0); my $btn = Gtk2::Button->new(''); $btn->set_image(Gtk2::Image->new_from_stock('gtk-close','m +enu')); $btn->signal_connect('clicked' => sub { $nb->remove_page ($nb->page_num($child)); }); $hbox->pack_end($btn,FALSE,FALSE,0); $hbox->show_all; #________ $nb->append_page ($child,$hbox); } $vbox_nb->pack_start($nb,TRUE,TRUE,0); $vbox_nb->pack_start(Gtk2::HSeparator->new(),FALSE,FALSE,5); #call the sub that will create the table containing #controls to manipulate the notebook $vbox_nb->pack_end(&nb_controls($nb),FALSE,FALSE,0); return $vbox_nb; } sub nb_controls { my ($nb) = @_; my $table = Gtk2::Table->new(3,2,TRUE); $table->attach_defaults(Gtk2::Label->new('Tab position:'),0,1,0,1) +; my $cb_position = Gtk2::ComboBox->new_text; foreach my $val (qw/left right top bottom/){ $cb_position->append_text($val); } $cb_position->signal_connect("changed" => sub { $nb->set_tab_pos($cb_position->get_active_text); }); $cb_position->set_active(2); $table->attach_defaults($cb_position,1,2,0,1); my $show_tabs = Gtk2::CheckButton->new("Show Tabs"); $show_tabs->set_active(TRUE); $show_tabs->signal_connect('toggled' =>sub { $nb->set_show_tabs($show_tabs->get_active); }); $table->attach_defaults($show_tabs,0,1,1,2); my $scrollable = Gtk2::CheckButton->new("Scrollable"); $scrollable->set_active(TRUE); $scrollable->signal_connect('toggled' =>sub { $nb->set_scrollable($scrollable->get_active); }); $table->attach_defaults($scrollable,1,2,1,2); my $popup = Gtk2::CheckButton->new("Popup Menu (right click on + tab)"); $popup->set_active(TRUE); $popup->signal_connect('toggled' =>sub { ($popup->get_active)&&($nb->popup_enable); ($popup->get_active)||($nb->popup_disable); }); $table->attach_defaults($popup,0,1,2,3); return $table; }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: Changing the geometry placement of Tk::Notebook tabs by zentara
in thread Changing the geometry placement of Tk::Notebook tabs by Popcorn Dave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.