SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Fedora 13 Zim-0.29-1.fc13.noarch.rpm

Gtk2::Ex::PathBar

Section: User Contributed Perl Documentation (3)
Updated: 2010-02-10
Index 

NAME

Gtk2::Ex::PathBar - A button path bar widget 

SYNOPSIS

        use Gtk2;        use Gtk2::Ex::PathBar;        use File::Spec;                my $pathbar = Gtk2::Ex::PathBar->new(spacing => 3);        $pathbar->show;                # show a path        my $name = '/foo/bar/baz';        my ($vol, $dir, $file) = File::Spec->splitpath($name);        my @path = (($vol || '/'), File::Spec->splitdir($dir), $file);        $pathbar->set_path(grep length($_), @path);        $pathbar->signal_connect(path_clicked => \&load_dir);        # or show a history        my @hist = qw(/foo/bar /tmp/baz /home/pardus);        $pathbar->set_path(map [basename($_), $_], @hist);        $pathbar->signal_connect(path_clicked => \&load_dir);        sub load_dir {                my ($button, @path) = @_;                # ...        }
 

DESCRIPTION

This widget is intended as a look-a-like for the ``button path bar'' usedin the gtk file dialog. Each part of the path is represented by a button.If the button row gets to long sliders are shown left and right to scrollthe bar.

It can be used to display a path to a file or directory or to displaysimilar data like a history (trace) or a namespace. 

HIERARCHY

  Glib::Object  +----Gtk2::Object        +----Gtk2::Widget              +----Gtk2::Container                   +----Gtk2::Box                        +----Gtk2::Ex::PathBar
 

METHODS

new(spacing => $spacing, ..)
Simple constructor, takes pairs of properties.
start_scrolling(DIRECTION)
Start continuous scrolling. DIRECTION can be either 'left' or 'right'.
stop_scrolling()
Stop continuous scrolling.
hide_sliders(BOOLEAN)
By default the sliders are made insensitive if you are displayingmultiple items but you scrolled to one end of the list.After setting this method sliders are hidden instead of showinginsensitive.
scroll_back(INT)
Scrolls the path bar one or more items back.This is to the left for left-to-right oriented environements.
scroll_forw(INT)
Scrolls the path bar one or more items forward.This is to the right for left-to-right oriented environements.
set_path(PART, PART, ..)
This method fills the path bar with a button for each part of the path.When one of theses buttons is clicked the 'path_clicked' signal is emittedwith as argument an array reference holding the path elements to that button.

You can also use array references instead of strings for the parts of the path.In this case the first element of these arrays is the string to display on the button. All other parts of the array are passed as a array reference to the'path_clicked' signal. This can be used if the data you want to display isnot really a path.

set_items(WIDGET, WIDGET, ..)
Low level method used by "set_path()" to fill the path bar with buttons.You can use this method to fill the path bar with your own buttons or other widgets.Of course widgets added with this method will not automaticly trigger the "path_clicked" signal.
get_items()
Returns a list of widgets coresponding to the items in the path bar.Notice that this differs from "get_children()" which will also giveyou the widgets for the sliders.
clear_items()
Removes all buttons from the path bar.
select_item(INDEX)
Selects the button associated with path part number INDEX in the array givento "set_path()" or "set_items()". This will have the same visual effect aswhen the user clicked the button in question.

If you used "set_items()" to add your own widgets you can also use an objectref instead of INDEX here.

 

SIGNALS

path_clicked(PATH, INDEX)
Emitted when one of the buttons in the path is clicked.PATH is an array reference containing the path coresponding to thebutton clicked. INDEX is the list index of the button in the path.
 

AUTHOR

Jaap Karssenberg || Pardus [Larus] <pardusAATTcpan.org>

Copyright (c) 2005 Jaap G Karssenberg. All rights reserved. This programis free software; you can redistribute it and/or modify it under the sameterms as Perl itself.


 

Index

NAME
SYNOPSIS
DESCRIPTION
HIERARCHY
METHODS
SIGNALS
AUTHOR

This document was created byman2html,using the manual pages.