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


Gtk2-Ex-Utils documentation  | view source Contained in the Gtk2-Ex-Utils distribution.

Index


NAME

Top

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

SYNOPSIS

Top

 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

Top

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

EXPORT TAGS

Top

:all :main :alter :create

FUNCTIONS BY TAG

Top

:main

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

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

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.

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

:create

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

Top

 Please report all bugs to the mailing list.

CONTRIBUTE

Top

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

Top

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

AUTHORS

Top

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

COPYRIGHT AND LICENSE

Top


Gtk2-Ex-Utils documentation  | view source Contained in the Gtk2-Ex-Utils distribution.