Re: which widget to use

On Sun, 2002-08-11 at 19:08, Jens Wilke wrote:

i'd like to make place a widget on the right side of the header of a notebook 
(to insert a button to close a tab, like in mozilla) Is there any possibility 
to do that?

Thks, Jens

You can use a Gtk::HBox instead of a Gtk::Label for the tab label and
just pack the label and button into it. 


use strict;
use warnings;

use Gtk;


my $window   = Gtk::Window->new;
my $vbox     = Gtk::VBox->new;
my $add_tab  = Gtk::Button->new("Add tab");
my $notebook = Gtk::Notebook->new;


$vbox->pack_start($add_tab,  0, 0, 0);
$vbox->pack_start($notebook, 1, 1, 0);


$window->signal_connect('destroy', sub { Gtk->main_quit });
        my $tab = 1;
                sub {
                        make_tab($notebook, $tab++)


sub make_tab {
        my ($nb, $tablabel) = @_;
        my $child = Gtk::VBox->new;
        my $hbox  = Gtk::HBox->new;
        my $label = Gtk::Label->new($tablabel);
        my $close = Gtk::Button->new("X");



                sub {



Today is Pungenday the 19th day of Bureaucracy in the YOLD 3168
Grudnuk demand sustenance!

Missile Address: 33:48:3.521N  84:23:34.786W

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]