NAME

Gtk2::Ex::History::Menu -- menu of "back" or "forward" history items

SYNOPSIS

use Gtk2::Ex::History::Menu;
my $my_menu = Gtk2::Ex::History::Menu->new
                (history => $my_history,
                 way => 'forward');

OBJECT HIERARCHY

Gtk2::Ex::History::Menu is a subclass of Gtk2::Ex::MenuView, though that's only really an implementation detail and the suggestion is not to rely on more than <Gtk2::Menu>.

Gtk2::Widget
  Gtk2::Container
    Gtk2::MenuShell
      Gtk2::Menu
        Gtk2::Ex::MenuView
          Gtk2::Ex::History::Menu

DESCRIPTION

A Gtk2::Ex::History::Menu presents a menu of either the "back" or "forward" choices from a Gtk2::Ex::History object. This menu is shown by Gtk2::Ex::History::Button and Gtk2::Ex::History::MenuToolButton. Selecting an item makes the History go back or forward to that item.

+--------------------+
| ---  ---  ---  --- |
| Thing last visited |
| The thing before   |
| An old thing       |
+--------------------+

The dashed tearoff item opens a Gtk2::Ex::History::Dialog. If there's no items to go "back" or "forward" then that tearoff is all that's in the menu.

FUNCTIONS

$histmenu = Gtk2::Ex::History::Menu->new (key => value, ...)

Create and return a new history menu. Optional key/value pairs set initial properties as per Glib::Object->new. The history property should be set to say what to display, and way for back or forward.

my $menu = Gtk2::Ex::History::Menu->new
             (history => $my_history,
              way => 'forward');
$histmenu = Gtk2::Ex::History::Menu->new_popup (key => value, ...)

Create and popup a new history menu. The key/value parameters set initial properties, plus an additional

event =>   Gtk2::Gdk::Event object or undef

If the event has button and time fields then they're used for the menu popup, and if the window field is set then that gives the screen (Gtk2::Gdk::Screen) the menu pops up on. For example,

sub my_button_press_handler {
  my ($self, $event) = @_;
  Gtk2::Ex::History::Menu->new_popup (history => $my_history,
                                      way     => 'back',
                                      event   => $event);
  return Gtk2::EVENT_PROPAGATE; # other handlers
}

PROPERTIES

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

The history object to display.

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

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

SEE ALSO

Gtk2::Ex::History, Gtk2::Ex::History::Button, Gtk2::Ex::History::MenuToolButton, Gtk2::Ex::History::Dialog, Gtk2::Ex::MenuView, Gtk2::Ex::Dashes::MenuItem

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/.