Gtk2-Ex-ErrorTextDialog
view release on metacpan or search on metacpan
devel/Action.pm view on Meta::CPAN
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
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.256 second using v1.01-cache-2.11-cpan-87723dcf8b7 )