Gtk2::Ex::Utils(3)
π Gtk2::Ex::Utils π
okay bestie, so this is Gtk2::Ex::Utils(3) β the extra Gtk2 utilities for working with Gnome2/Gtk2 in Perl. it's from the User Contributed Perl Documentation, and it is literally just a little grab-bag of helper functions that make your Gnome2/Gtk2 Perl life so much easier. no cap. πΈ
β¨ 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 π¦
so basically this module hands you a bunch of simple utility functions that are genuinely useful when you're doing Gnome2/Gtk2 Perl programming. that's the whole vibe. it's giving "small module, big helper energy". π
π EXPORT TAGS π
here are the tags you can pull in, bestie:
:all :main :alter :create
π FUNCTIONS BY TAG π
π :main
process_pending_events ( )β for all the pending events, this runs through the main loop once. so useful for long processes where you need the user interface to actually update and stop looking frozen. π₯process_main_exit ( [ EXIT_VALUE ] )β this will quit the main event loop, but only after all pending events have been given one last run through the main loop. once the UI work is done, it exits with the value you gave it, or zero if you gave it nothing. and here's the cute part: if the exit value you pass is the string'no-exit', the function will returnTRUEinstead of exiting. π
π :alter
DOUBLE = force_progress_bounds ( DOUBLE )β used with Gtk2 progress bars to make sure a given value is inside the0.00to1.00bounds so you've got valid percentages. if the value is out of bounds, this function will modify it appropriately to either0.00or1.00. no more cursed progress bars. β¨Gtk2::Label = make_label_wrap_left_centred ( Gtk2::Label )β hand it aGtk2::Labeland it will center the alignment, left justify the text, make the label selectable, and make the label wrap lines. all four, at once. it ate. π
π§ :create
Gtk2::Button = create_mnemonic_icon_button ( ICON, STRING )β this creates a brand newGtk2::Button, aGtk2::Imageand a label, then packs the image and label into an hbox inside the button. the label isnew_with_mnemonic, and theICONyou pass can be one of these types:- a stock-id string
- the path to an image file
- a
Gtk2::Imageobject - a
Gtk2::Gdk::Pixbufobject
and the button keeps references to the three components like this: $button->{HBOX}, $button->{LABEL} and $button->{IMAGE}. iconic. π«Ά
π BUGS π
Please report all bugs to the mailing list.
πΈ CONTRIBUTE πΈ
if you've got a utility function that's related to Gnome2/Gtk2 Perl, that is not already implemented in here, and you feel like other people might benefit from it being included, please do not hesitate to send it to the mailing list. we love a collab. π
π 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 ποΈ
okay so legally I have to give you all of this exactly as written, bestie. it's important. read it. π
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
π POD ERRORS π
Hey! The above document had some coding errors, which are explained below:
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'
and that's the whole page, bestie!! this one shipped as perl v5.42.0, dated 2025-07-25, so shoutout to that exact build for blessing us with this doc. go forth and process_pending_events() your little heart out. π¦β¨π
π¦ where this page comes from
- fedora 43: perl-Gtk2-Ex-Utils 0.09-49.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms