Gtk2::E...Question(3)
π Gtk2::E...Question(3) β the manual page, bestie edition π
okay so. welcome to the User Contributed Perl Documentation for Gtk2::Ex::Dialogs::Question, aka the little module that pops up a yes/no question and lets your user be the main character for three seconds. sit down, grab a strawberry π, and let's go.
β¨ NAME β¨
Gtk2::Ex::Dialogs::Question β it literally just provides a simple question dialog. that's the whole vibe. no cap. π
πΈ SYNOPSIS πΈ
here's how you actually use it, copy-paste ready, exact characters and everything:
use Gtk2::Ex::Dialogs::Question ( 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::Question::parent_window = $window;
# now popup a new dialog
my $r = ask Gtk2::Ex::Dialogs::Question ( "Is Perl only hacker's glue?" );
if ( $r ) {
# end-user thinks so
} else {
# end-user does not think so
}
look at that. asking the real questions. π
π¦ DESCRIPTION π¦
this module hands you a simple dialog api that wraps Gtk2::Dialog objectively. and what's the objective, you ask? a clean and simple question dialog β literally just a "NO" button and a "YES" button. that's it. that's the dream. it's giving minimalism. it ate. π
π OPTIONS π
all public methods (and honestly the entire class, she's generous like that) support these options:
title=> STRING β the title of the dialog window. defaults to an empty string. so if you don't say anything, she's mysterious. πtext=> STRING β the text to be displayed. this is the core purpose of the whole module and it's the only mandatory argument. yes, the only one. everything else is optional garnish. β¨icon=>/path/to/image|| stock-id ||Gtk2::Gdk::Pixbuf||Gtk2::Imageβ the dialog-sized image that goes to the left of the text. quick note bestie: there are five aliased stock-ids which correspond to the fivegtk-dialog-*ids β"warning","question","info","error"and"authentication". defaults to the stock-id"gtk-dialog-question". iconic lineup fr fr. πparent_window=>Gtk2::Windowβ reference to the main application window. your app's mother, basically.destroy_with_parent=> BOOL β when theparent_windowis destroyed, what do we do? defaults toFALSE. (the suspense.)modal=> BOOL β does this message make theparent_windowfreeze while the message exists? defaults toFALSE. so by default nobody's frozen. no drama. π§no_separator=> BOOL β draw the horizontal separator between the content area and the button area below? defaults toFALSE. so the line is there unless you say otherwise. very demure, very mindful separator. πdefault_yes=> BOOL β autofocus on the "YES" button. defaults toFALSE. (flip it if you want the optimistic button pre-selected. π«Ά)
π PUBLIC METHODS π
OBJECT = new ( OPTIONS | STRING )
creates a new Gtk2::Dialog with stock "NO" and "YES" buttons, some text, and an optional icon to the left of the text. the icon can be any of these:
- a stock-id string
- a
Gtk2::Image - a
Gtk2::Gdk::Pixbuf - the full path to an image
returns a Gtk2::Ex::Dialogs::Question object. π
now for the special case, and this one's cute: if you pass only one argument, all options get set to defaults and that one argument gets used as the text argument. one-arg wonder.
heads up though β use ofnew()is discouraged in favour ofask()ornew_and_run(). she said pick the other door. πͺ
RESPONSE = ask ( OPTIONS | STRING ) | new_and_run ( OPTIONS | STRING )
supports all the same arguments as new(). what it does: creates a new Gtk2::Ex::Dialogs::Question, calls show_all(), calls run(), and returns the response of TRUE/'yes' or FALSE/''.
and the tea: ask() is the alias for new_and_run(). same girl, two names. π
π SEE ALSO π
go look at these when you're done, 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. she's not mad, she just wants to know. π
πΈ 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>
legends, honestly.
π COPYRIGHT AND LICENSE π
Gtk2::Ex::Dialogs::Question - Provides a simple question 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
and that's the whole page, bestie. this one shipped as perl v5.42.0, dated 2025-07-25, filed under Gtk2::E...Question(3). go forth and ask your questions. π
β¨ periodt.
π¦ 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