Glib-Object-Introspection
view release on metacpan or search on metacpan
bin/perli11ndoc view on Meta::CPAN
my ($result_view, $event) = @_;
return $handle_button->($event, sub {
$self->go_to_path ($_[0]->{__target});
});
});
$self->{result_buffer} = $result_buffer;
$self->{result_view} = $result_view;
}
sub update_gir_view {
my ($self) = @_;
$self->{suppress_gir_view_selection_changes} = TRUE;
$self->{gir_model}->clear;
$self->{search_entry}->set_text ('');
$self->{path_bar}->clear;
my $inserter = sub {
my ($iter, $text, $path, $is_cat, $is_vis) = @_;
bin/perli11ndoc view on Meta::CPAN
$self->go_to_path ($path);
}
}
sub go_to_path {
my ($self, $path) = @_;
my $name = $self->{parser}->format_node_name_by_path ($path);
$self->{path_bar}->append ($name, $path); # indirectly calls update_results
}
sub update_results {
my ($self, $path) = @_;
$self->display_results ($self->{parser}->format_node_by_path ($path));
# Show and select the correponding tree entry.
$self->{gir_model}->foreach (sub {
my ($model, $tree_path, $iter) = @_;
my $this_path = $model->get ($iter, GIR_VIEW_COL_PATH);
if (defined $this_path && $this_path eq $path) {
$self->{gir_view}->expand_to_path ($tree_path);
$self->{gir_view}->scroll_to_cell ($tree_path, undef, FALSE, 0.0, 0.0);
bin/perli11ndoc view on Meta::CPAN
sub append {
my ($self, $name, $path) = @_;
$self->{path_label}->append ($name, $path);
}
sub set_update_func {
my ($self, $func) = @_;
$self->{update_func} = $func;
}
sub update_buttons {
my ($self) = @_;
$self->{back_button}->set_sensitive ($self->{path_label}->can_go_back);
$self->{forward_button}->set_sensitive ($self->{path_label}->can_go_forward);
}
package PathLabel;
# The BEGIN { eval } dance is to support not loading Gtk3 in text mode.
BEGIN { eval {use Glib::Object::Subclass qw/Gtk3::Label/;} }
bin/perli11ndoc view on Meta::CPAN
return unless $self->{current_child} < $#{$self->{children}};
$self->{current_child}++;
$self->update;
}
sub set_update_func {
my ($self, $func) = @_;
$self->{update_func} = $func;
}
sub update {
my ($self) = @_;
$self->set_markup ($self->_format_children);
if (defined $self->{current_child} && defined $self->{update_func}) {
my $child = $self->{children}->[$self->{current_child}];
$self->{update_func}->($child->{name}, $child->{path});
}
}
sub GET_PREFERRED_WIDTH {
#say 'GET_PREFERRED_WIDTH';
( run in 0.270 second using v1.01-cache-2.11-cpan-87723dcf8b7 )