Gtk2-Ex-MenuView

 view release on metacpan or  search on metacpan

devel/cellview.pl  view on Meta::CPAN

}
{
  my $label = Gtk2::Label->new (' ');
  $left_vbox->add ($label);
}
{
  my $button = Gtk2::Button->new_with_label ('Insert');
  $button->signal_connect
    (clicked => sub {
       $model->insert_with_values (undef, 99999, 0 => rand());
     });
  $left_vbox->pack_start ($button, 0,0,0);
}
{
  my $button = Gtk2::Button->new_with_label ('Change 2');
  $button->signal_connect
    (clicked => sub {
       my $iter = $model->iter_nth_child (undef, 1);
       $model->set ($iter, 0, 'x' . $model->get($iter,0));
     });
  $left_vbox->pack_start ($button, 0,0,0);
}
{
  my $button = Gtk2::Button->new_with_label ('Insert 2');
  $button->signal_connect
    (clicked => sub {
       $model->insert_with_values (undef, 1, 0 => rand());
     });
  $left_vbox->pack_start ($button, 0,0,0);
}
{
  my $button = Gtk2::Button->new_with_label ('Delete');
  $button->signal_connect
    (clicked => sub {
       my $iter = $model->get_iter (Gtk2::TreePath->new(2));
       if ($iter) { $model->remove ($iter); }
     });
  $left_vbox->pack_start ($button, 0,0,0);
}
{
  my $button = Gtk2::Button->new_with_label ('Reorder Up');
  $button->signal_connect
    (clicked => sub {
       my $len = $model->iter_n_children (undef);
       my $end = $len - 1;
       $model->reorder (undef, 1 .. $end, 0);  # rotate
     });
  $left_vbox->pack_start ($button, 0,0,0);
}
{
  my $button = Gtk2::Button->new_with_label ('Reorder Down');
  $button->signal_connect
    (clicked => sub {
       my $len = $model->iter_n_children (undef);
       my $end = $len - 1;
       $model->reorder (undef, $end, 0 .. $end-1); # rotate
     });
  $left_vbox->pack_start ($button, 0,0,0);
}

$menu->popup (undef, undef, undef, undef, 0, 0);

$toplevel->show_all;
Gtk2->main;
exit 0;



( run in 1.573 second using v1.01-cache-2.11-cpan-364913b4093 )