Kevin C. Krinke

NAME

Gtk2::Ex::Utils - Extra Gtk2 Utilities for working with Gnome2/Gtk2 in Perl.

SYNOPSIS

 use Gtk2::Ex::Utils qw( :main );

 # do stuff
 ...

 # Update the UI and react to pending events
 process_pending_events();

 # do more stuff
 ...

 # Exit the program with a value of 255 for some reason
 process_main_exit( 255 );

DESCRIPTION

This module provides simple utility functions useful for Gnome2/Gtk2 Perl programming.

EXPORT TAGS

    :all :main :alter :create

FUNCTIONS BY TAG

:main

process_pending_events ( )

For all pending events, run through the main loop once. Useful for long processes to update the user interface.

process_main_exit ( [ EXIT_VALUE ] )

This will quit the main event loop after all pending events have been given a run through the main loop one last time. Once the UI work is done, exit with the value given or zero. Should the exit value passed be the string 'no-exit', the function will return TRUE instead of exiting.

:alter

DOUBLE = force_progress_bounds ( DOUBLE )

Used with Gtk2 progress bars to ensure a given value is within the 0.00 to 1.00 bounds for valid percentages. This function will modify invalid values appropriately to either 0.00 or 1.00 should the value be out of bounds.

Gtk2::Label = make_label_wrap_left_centred ( Gtk2::Label )

Given a Gtk2::Label will center the alignment, left justify the text, make the label selectable and make the label wrap lines.

:create

Gtk2::Button = create_mnemonic_icon_button ( ICON, STRING )

This will create a new Gtk2::Button, a Gtk2::Image and a label then pack the image and label into an hbox inside the button. The label is new_with_mnemonic and the ICON given can be one of the following types: a stock-id string, the path to an image file, a Gtk2::Image object or a Gtk2::Gdk::Pixbuf object. The button has references to the three components as follows: $button->{HBOX}, $button->{LABEL} and $button->{IMAGE}.

BUGS

 Please report all bugs to the mailing list.

CONTRIBUTE

If you've got a utility function that is related to Gnome2/Gtk2 Perl, that is not already implemented in here and feel that others may benefit from it's inclusion here, please do not hesitate to send it to the mailing list.

MAILING LIST

 http://opendoorsoftware.com/lists/gtk2-ex-list
 gtk2-ex-list@opendoorsoftware.com

AUTHORS

 Kevin C. Krinke, <kckrinke@opendoorsoftware.com>
 James Greenhalgh, <jgreenhalgh@opendoorsoftware.com>

COPYRIGHT AND LICENSE

 Gtk2::Ex::Utils - Useful utility functions for working with Gnome2/Gtk2 Perl.
 Copyright (C) 2005 Open Door Software Inc. <ods@opendoorsoftware.com>

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

 This library 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
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA

6 POD Errors

The following errors were encountered while parsing the POD:

Around line 74:

'=item' outside of any '=over'

Around line 116:

You forgot a '=back' before '=head2'

Around line 118:

'=item' outside of any '=over'

Around line 167:

You forgot a '=back' before '=head2'

Around line 169:

'=item' outside of any '=over'

Around line 221:

You forgot a '=back' before '=head1'