10 Jun 2011 01:41:41 UTC
- Distribution: Gtk2-Ex-History
- Module version: 8
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (1059 / 1 / 1)
- KwaliteeBus factor: 1
- 87.50% Coverage
- License: open_source
- Perl: v5.8.0
- Activity24 month
- Download (52.88KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionKRYDE Kevin Rydeand 1 contributors
- Kevin Ryde
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
Gtk2::Ex::History -- previously visited things
use Gtk2::Ex::History; my $history = Gtk2::Ex::History->new;
Gtk2::Ex::Historyis a subclass of
Gtk2::Ex::Historyobject records visited places and allows the user to go "back" and "forward" with control buttons, menus, dialog, including through a UIManager action. (See Gtk2::Ex::History::Button etc.)
A place is any Perl scalar. It could be a byte string filename, a wide-char document name, an object such as a
URI, or a little hashref or arrayref to hold multiple bits together identifying a place.
$history = Gtk2::Ex::History->new (key => value, ...)
Create and return a new history object. Optional key/value pairs set initial properties as per
$placeas the current place in
$history. If the current is different from
$placethen that previous current is pushed onto the "back" list.
$place = $history->back ()
$place = $history->back ($n)
$place = $history->forward ()
$place = $history->forward ($n)
Go back or forward in
$historyone place, or a given
$nplaces. The return is the new current place, or
undefif nothing further to go to.
$placefrom the history.
(At present it's not removed from the "current", only from the back and forward lists. This will probably change ...)
The current place.
max-history(integer, default 40)
The maximum number of items to record in the history.
place-to-text(scalar; return string)
This signal is emitted to turn a place object into text to display in the Menu and Dialog user elements. The default is a Perl stringize
A handler should return a wide-char string. If it's bytes then they're "upgraded" in the usual way (treating the bytes as Latin-1).
Glib::filename_display_name()(see Glib) gives a reasonable form to display, interpreting non-ASCII in the filesystem locale charset.
See examples/iri.pl in the Gtk2-Ex-History sources for a complete program turning URL internationalized %-encodings into wide characters for display.
place-equal(scalar, scalar; return boolean)
This signal is emitted to check equality of two places.
gotoand other things use it to avoid pushing multiple copies of the same place onto the history. The default handler compares with Perl
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/.
Module Install Instructions
To install Gtk2::Ex::History, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Gtk2::Ex::History
For more information on module installation, please visit the detailed CPAN module installation guide.