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

Re: [xs] notebook problem



On Mon, 21 Apr 2003, Joe Smith wrote:

> Chas Owens wrote:
> > ... this line needs to read
> > $notebook_main->append_page( $table_create, Gtk2::Label->new("Skeleton"));
>
> Is there any reason this shouldn't be the default?  I mean, everybody
> seems to like Button->new("Click Me").
>
> <Joe

The difference is that you don't normally pack a other widgits into a button,
whereas I often say:


sub add_results {
	my ($self, @results) = shift;
	my $hbox             = Gtk2::HBox->new;
	my $close            = Gtk2::Button->new("X");
	$hbox->add(Gtk2::Label->new("Results 1"));
	$hbox->add($close);

	my $sw = Gtk2::ScrolledWindow->new;
	#yadda yadda yadda

	$self->append_page($sw, $hbox);

	$close->signal_connect(
		'clicked',
		sub {
			$self->remove_page($self->page_num($sw));
		}
	);
}







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