Gtk2::E...ErrorMsg(3)
β¨ Gtk2::E...ErrorMsg β the girlies' guide β¨
okay so bestie, welcome to Gtk2::E...ErrorMsg(3) π this is from the User Contributed Perl Documentation section and it's literally the cutest little error popup module you've ever met. sit down, grab a boba π§, we're doing this.
πΈ NAME πΈ
Gtk2::Ex::Dialogs::ErrorMsg β it's giving "provides a simple error message dialog." periodt. that's the whole job. no cap. π
π¦ SYNOPSIS π¦
here's the vibe, copy-paste ready:
use Gtk2::Ex::Dialogs::ErrorMsg ( destroy_with_parent => TRUE,
modal => TRUE,
no_separator => FALSE );
# do some stuff like creating your app's main $window then,
# to ensure that all messages use the right parent, set it:
$Gtk2::Ex::Dialogs::ErrorMsg::parent_window = $window;
# now popup a new dialog ( blocking the main loop if there is one )
new_and_run Gtk2::Ex::Dialogs::ErrorMsg ( "Simple error message." );
# now popup a somwhat useful dialog that doesn't block any main loop
# but on the other side of the coin, if there is no main loop the
# dialog will be completely unresponsive.
new_and_show Gtk2::Ex::Dialogs::ErrorMsg ( "Use when there is a main loop." );
see how clean that is?? main character energy fr fr π
π DESCRIPTION π
so this module hands you a simple dialog api that wraps Gtk2::Dialog objectively. the whole goal β the dream, the vision, the slay β is a clean and simple message dialog. and when we say simple we mean only an "OK" button. one button. that's it. iconic behaviour honestly. β¨
π OPTIONS π
all public methods (and literally the entire class, she's generous like that π«Ά) support these:
title => STRINGβ the title of the dialog window. defaults to"Error"πtext => STRINGβ the text to be displayed. this is the whole point of the module, the moment, the reason we're all here, and it's the only mandatory argument. no text, no dialog, bestie.icon => /path/to/image || stock-id || Gtk2::Gdk::Pixbuf || Gtk2::Imageβ the dialog-sized image that sits to the left of the text. quick note: there are five aliased stock-ids that correspond to the fivegtk-dialog-*ids β"warning","question","info","error"and"authentication". defaults to the stock-id of"gtk-dialog-error"πparent_window => Gtk2::Windowβ reference to the main application window. your app's whole parent, basically.destroy_with_parent => BOOLβ when theparent_windowgets destroyed... what do we do?? π€ defaults toFALSE.modal => BOOLβ does this message make theparent_windowfreeze while the message exists? defaults toFALSE.no_separator => BOOLβ draws the horizontal separator between the content area and the button area below. defaults toFALSE.
π PUBLIC METHODS π
OBJECT = new ( OPTIONS | STRING )
creates a brand new Gtk2::Dialog with only an "OK" button, some text, and an optional icon to the left of the text. the icon can be any of these cuties: a stock-id string, a Gtk2::Image, a Gtk2::Gdk::Pixbuf, or the full path to an image. returns a Gtk2::Ex::Dialogs::ErrorMsg object. π
and here's the special case, iykyk: if you pass only one argument, then every option gets set to its defaults and that one lone argument is used as the text option. slay. β¨
new_and_run ( OPTIONS | STRING )
supports all the same arguments as new(). this one creates a new Gtk2::Ex::Dialogs::Message, does show_all(), does run(), and then destroys the dialog immediately. she doesn't linger, she's efficient π
new_and_show ( OPTIONS )
supports all the same arguments as new(). this one creates a new Gtk2::Ex::Dialogs::Message, calls show_all(), and processes any pending gtk events.
π¨ okay real talk bestie: this functionality is only of any practical use when there is a Gtk2 main loop running. if there is no main loop running, the dialog will be visible but completely unresponsive to the end-user. like, on screen, doing nothing, ghosting you. π
π SEE ALSO π
go read these next, they're all in the same friend group:
Gtk2::DialogGtk2::MessageDialogGtk2::Ex::DialogsGtk2::Ex::Dialogs::ChooseDirectoryGtk2::Ex::Dialogs::ChooseFileGtk2::Ex::Dialogs::ChoosePreviewFileGtk2::Ex::Dialogs::ErrorMsgGtk2::Ex::Dialogs::Message
π BUGS π
please report any bugs to the mailing list. we don't do silent suffering in this house π«Ά
π¬ MAILING LIST π¬
http://opendoorsoftware.com/lists/gtk2-ex-listgtk2-ex-list@opendoorsoftware.com
π AUTHORS π
- Kevin C. Krinke,
<kckrinke@opendoorsoftware.com> - James Greenhalgh,
<jgreenhalgh@opendoorsoftware.com>
βοΈ COPYRIGHT AND LICENSE βοΈ
Gtk2::Ex::Dialogs::ErrorMsg β Provides a simple error message dialog.
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
okay and that's the whole page bestie, no notes, we ate ππ
this little beauty came to you courtesy of perl v5.42.0, dated 2025-07-25, from the Gtk2::E...ErrorMsg(3) corner of the User Contributed Perl Documentation. mwah. πβ¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Gtk2-Ex-Dialogs 0.11-49.fc43 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms