Gtk2-Ex-FormFactory
view release on metacpan or search on metacpan
lib/Gtk2/Ex/FormFactory/Container.pm view on Meta::CPAN
}
1;
}
sub add_child_widget {
my $self = shift;
my ($child) = @_;
push @{$self->get_content}, $child;
return unless $self->get_built;
my $form_factory = $self->get_form_factory;
my $layouter = $form_factory->get_layouter;
$form_factory->register_all_widgets($child);
$child->set_parent($self);
$child->set_form_factory($form_factory);
$child->build;
$layouter->add_widget_to_container($child, $self);
$child->connect_signals;
$child->update_all;
$child->get_gtk_parent_widget->show_all;
1;
}
sub remove_child_widget {
my $self = shift;
my ($child) = @_;
my $found;
my $i = 0;
foreach my $c ( @{$self->get_content} ) {
$found = 1, last if $c eq $child;
++$i;
}
die "Widget '".$child->get_name.
"' no child of container '".
$self->get_name."'" unless $found;
splice @{$self->get_content}, $i, 1;
return unless $self->get_built;
my $child_gtk_widget = $child->get_gtk_parent_widget;
my $gtk_widget = $self->get_gtk_widget;
$gtk_widget->remove($child_gtk_widget);
$child->cleanup;
1;
}
sub update_all {
my $self = shift;
$self->SUPER::update(@_);
foreach my $c ( @{$self->get_content} ) {
$c->update_all;
}
1;
}
sub apply_changes_all {
my $self = shift;
$self->SUPER::apply_changes(@_);
foreach my $c ( @{$self->get_content} ) {
$c->apply_changes_all;
}
1;
}
sub commit_proxy_buffers_all {
my $self = shift;
$self->SUPER::commit_proxy_buffers(@_);
foreach my $c ( @{$self->get_content} ) {
$c->commit_proxy_buffers_all;
}
1;
}
sub discard_proxy_buffers_all {
my $self = shift;
$self->SUPER::discard_proxy_buffers(@_);
foreach my $c ( @{$self->get_content} ) {
$c->discard_proxy_buffers_all;
}
1;
}
sub connect_signals {
my $self = shift;
$self->SUPER::connect_signals(@_);
foreach my $c ( @{$self->get_content} ) {
$c->connect_signals;
}
1;
}
sub cleanup {
my $self = shift;
( run in 1.502 second using v1.01-cache-2.11-cpan-39bf76dae61 )