Gtk2-Ex-WidgetBits

 view release on metacpan or  search on metacpan

lib/Gtk2/Ex/TableBits.pm  view on Meta::CPAN


my @attach_pnames = ('left-attach',
                     'right-attach',
                     'top-attach',
                     'bottom-attach',
                     'x-options',
                     'y-options',
                     'x-padding',
                     'y-padding');

sub update_attach {
  my ($table, $child, @args) = @_;
  ### TableBits update_attach: "$child", @args

  if (! _child_is_attached_at($table, $child, @args)) {
    ### must re-attach ...
    if (my $parent = $child->get_parent) {
      $parent->remove ($child);
    }
    $table->attach ($child, @args);
  }

lib/Gtk2/Ex/ToolItem/OverflowToDialog/Dialog.pm  view on Meta::CPAN

  my ($self) = @_;
  # chain first to set $dialog->mapped flag
  # Or is it better to move the child first to establish the initial size?
  shift->signal_chain_from_overridden;
  if (my $toolitem = $self->{'toolitem'}) {
    Gtk2::Ex::ToolItem::OverflowToDialog::_update_child_position ($toolitem);
  }
}

# called by toolitem when overflow-mnemonic changes
sub update_text {
  my ($self) = @_;
  my $toolitem = $self->{'toolitem'};
  my $str = $toolitem && $toolitem->get('overflow-mnemonic');
  # Gtk 2.0.x gtk_label_set_label() didn't allow NULL, so empty ''
  if (! defined $str) { $str = ''; }
  $str = Gtk2::Ex::MenuBits::mnemonic_undo ($str);
  $self->{'label'}->set_label ($str);
  $self->set_title ($str);
}

# called by toolitem for hierarchy-changed
sub update_transient_for {
  my ($self) = @_;
  my $toolitem = $self->{'toolitem'};
  my $toplevel = $toolitem && $toolitem->get_toplevel;
  $self->set_transient_for ($toplevel && $toplevel->isa('Gtk2::Window')
                            ? $toplevel : undef);
}

sub present_for_menuitem {
  my ($self, $menuitem) = @_;
  if ($self->can('set_screen')) { # new in Gtk 2.2



( run in 0.475 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )