Gtk2-Ex-ErrorTextDialog

 view release on metacpan or  search on metacpan

devel/Action.pm  view on Meta::CPAN

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
      Gtk2::Action
        Gtk2::Ex::ErrorTextDialog::Action
 
=head1 DESCRIPTION
 
C<Gtk2::Ex::ErrorTextDialog::Action> invokes either C<back> or C<forward> on
a given C<Gtk2::Ex::ErrorTextDialog>.  The "stock" icon and tooltip follow
the direction.  The action is insensitive when the history is empty.
 
When the action is used on a toolbar button a mouse button-3 handler is
added to popup C<Gtk2::Ex::ErrorTextDialog::Menu>.
 
If you're not using UIManager and its actions system then see
L<Gtk2::Ex::ErrorTextDialog::Button> for similar button-3 behaviour.
 
There's no accelerator keys offered as yet.  "B" and "F" would be natural,
but would depend what other things are in the UIManager and whether letters
should be reserved for text entry etc, or are available as accelerators.
Control-B and Control-F aren't good choices if using a text entry as they're
cursor movement in the Emacs style
F</usr/share/themes/Emacs/gtk-2.0-key/gtkrc>.

devel/action.pl  view on Meta::CPAN

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
my $action = Gtk2::Ex::ErrorTextDialog::Action->new;
# (name => 'MyErrorTextDialog');
$actiongroup->add_action_with_accel ($action, '<Ctrl><Shift>E');
 
my $ui = Gtk2::UIManager->new;
$toplevel->add_accel_group ($ui->get_accel_group);
$ui->insert_action_group ($actiongroup, 0);
 
$actiongroup->add_actions
  ([
    { name => 'FileMenu'label => '_File'  },
   ],
   'my-userdata');
 
$ui->add_ui_from_string (<<'HERE');
<ui>
  <menubar name='MenuBar'>
    <menu action='FileMenu'>
      <menuitem action='ErrorTextDialog'/>
    </menu>
  </menubar>
  <toolbar  name='ToolBar'>
    <toolitem action='ErrorTextDialog'/>
  </toolbar>
</ui>
HERE
 
my $menubar = $ui->get_widget ('/MenuBar');
$vbox->pack_start ($menubar, 0,0,0);
 
my $toolbar = $ui->get_widget ('/ToolBar');
$vbox->pack_start ($toolbar, 0,0,0);
 
$toplevel->show_all;
Gtk2->main;
exit 0;



( run in 0.441 second using v1.01-cache-2.11-cpan-87723dcf8b7 )