Gtk2::Ex::Utils(3)

πŸ“¦
version 0.09 Β· 2 versions
, in fedora 43

πŸ’– 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 return TRUE instead of exiting. 🌈

πŸ’œ :alter

  • DOUBLE = force_progress_bounds ( DOUBLE ) β€” used with Gtk2 progress bars to make sure a given value is inside the 0.00 to 1.00 bounds so you've got valid percentages. if the value is out of bounds, this function will modify it appropriately to either 0.00 or 1.00. no more cursed progress bars. ✨
  • Gtk2::Label = make_label_wrap_left_centred ( Gtk2::Label ) β€” hand it a Gtk2::Label and 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 new Gtk2::Button, a Gtk2::Image and a label, then packs the image and label into an hbox inside the button. the label is new_with_mnemonic, and the ICON you pass can be one of these types:
    • a stock-id string
    • the path to an image file
    • a Gtk2::Image object
    • a Gtk2::Gdk::Pixbuf object

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>

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