Kevin Ryde > Gtk2-Ex-History > Gtk2::Ex::History::Button

Download:
Gtk2-Ex-History-8.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 8   Source  

NAME ^

Gtk2::Ex::History::Button -- button for history "back" or "forward"

SYNOPSIS ^

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

OBJECT HIERARCHY ^

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

    Gtk2::Widget
      Gtk2::Container
        Gtk2::Bin
          Gtk2::Button
            Gtk2::Ex::History::Button

DESCRIPTION ^

A Gtk2::Ex::History::Button invokes either back or forward on a Gtk2::Ex::History object.

    +--------------+
    | ==>  Forward |
    +--------------+

Mouse button-3 opens a Gtk2::Ex::History::Menu to select an entry from a menu to jump to, to go more than one place back or forward.

A button like this can be used anywhere desired. If it's put in a Gtk2::ToolItem it can be used in a Gtk2::Toolbar, though if using Gtk2::UIManager then see Gtk2::Ex::History::Action instead.

FUNCTIONS ^

$button = Gtk2::Ex::History::Button->new (key => value, ...)

Create and return a new history button. Optional key/value pairs can be given to 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 $button = Gtk2::Ex::History::Button->new
                    (history => $history,
                     way => 'forward');

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.

BUGS ^

The initial button display is empty, not the intended default way "back". Setting a history object or an explicit initial way works.

    my $button = Gtk2::Ex::History::Button->new
                    (way => 'back');    # explicit as a workaround

It's something to do with object "constructor" stuff making the stock icon setup in INIT_INSTANCE not work. Usually you set a history in initially and that's jigged up to kick it into life.

    my $button = Gtk2::Ex::History::Button->new
                    (history => $history);    # ok, "back" button

SEE ALSO ^

Gtk2::Ex::History, Gtk2::Ex::History::Menu, Gtk2::Ex::History::MenuToolButton, Gtk2::Ex::History::Action, Gtk2::Button

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

syntax highlighting: