NAME

Gtk2::Ex::History::Action -- Gtk2::Action to go back or forward in a history

SYNOPSIS

use Gtk2::Ex::History::Action;
my $action = Gtk2::Ex::History::Action->new
                (name    => 'ForwardInHistory',
                 way     => 'forward',
                 history => $my_history);
$actiongroup->add_action_with_accel ($action, '<Ctrl><Shift>F');

OBJECT HIERARCHY

Gtk2::Ex::History::Action is a subclass of Gtk2::Action.

Gtk2::Widget
  Gtk2::Action
    Gtk2::Ex::History::Action

DESCRIPTION

Gtk2::Ex::History::Action invokes either back or forward on a given Gtk2::Ex::History. 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 Gtk2::Ex::History::Menu.

If you're not using UIManager and its actions system then see Gtk2::Ex::History::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 /usr/share/themes/Emacs/gtk-2.0-key/gtkrc.

FUNCTIONS

$action = Gtk2::Ex::History::Action->new (key => value, ...)

Create and return a new action object. Optional key/value pairs set initial properties per Glib::Object->new.

The history property is what to act on, and way for back or forward. The usual action name property should be set to identify it in a UIManager or similar. The name can be anything desired. Just "Back" and "Forward" are good, or something more to distinguish it from other actions.

my $action = Gtk2::Ex::History::Action->new
                (name    => 'ForwardHistory',
                 way     => 'forward',
                 history => $history);

PROPERTIES

history (Gtk2::Ex::History object, default undef)

The history object to act on.

way (enum Gtk2::Ex::History::Way, default 'back')

The direction to go, either "back" or "forward".

The "stock" icon is set from this, either gtk-go-back or gtk-go-forward.

SEE ALSO

Gtk2::Ex::History, Gtk2::Ex::History::Button, Gtk2::Action, Gtk2::ActionGroup, Gtk2::UIManager

HOME PAGE

http://user42.tuxfamily.org/gtk2-ex-history/index.html

LICENSE

Gtk2-Ex-History is Copyright 2010, 2011 Kevin Ryde

Gtk2-Ex-History is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Gtk2-Ex-History is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Gtk2-Ex-History. If not, see http://www.gnu.org/licenses/.