1Gtk2::Ex::Dialogs::QuesUtsieorn(C3o)ntributed Perl DocumGetnkt2a:t:iEoxn::Dialogs::Question(3)
2
3
4
6 Gtk2::Ex::Dialogs::Question - Provides a simple question dialog.
7
9 use Gtk2::Ex::Dialogs::Question ( destroy_with_parent => TRUE,
10 modal => TRUE,
11 no_separator => FALSE );
12
13 # do some stuff like creating your app's main $window then,
14 # to ensure that all messages use the right parent, set it:
15 $Gtk2::Ex::Dialogs::Question::parent_window = $window;
16
17 # now popup a new dialog
18 my $r = ask Gtk2::Ex::Dialogs::Question ( "Is Perl only hacker's glue?" );
19 if ( $r ) {
20 # end-user thinks so
21 } else {
22 # end-user does not think so
23 }
24
26 This module provides a simple dialog api that wraps Gtk2::Dialog
27 objectively. The objective is a clean and simple question dialog (just
28 "NO" and "YES" buttons).
29
31 All public methods (and the entire class) support the following
32 options:
33
34 title => STRING
35 The title of the dialog window. Defaults to an empty string.
36
37 text => STRING
38 The text to be displayed. This is the core purpose of the module
39 and is the only mandatory argument.
40
41 icon => /path/to/image || stock-id || Gtk2::Gdk::Pixbuf || Gtk2::Image
42 The dialog-sized image to place to the left of the text. Note:
43 there are five aliased stock-ids which correspond to the five
44 gtk-dialog-* ids, "warning", "question", "info", "error" and
45 "authentication". Defaults to the stock-id "gtk-dialog-question".
46
47 parent_window => Gtk2::Window
48 Reference to the main application window.
49
50 destroy_with_parent => BOOL
51 When the parent_window is destroyed, what do we do? Defaults to
52 FALSE.
53
54 modal => BOOL
55 Does this message make the parent_window freeze while the message
56 exists. Defaults to FALSE.
57
58 no_separator => BOOL
59 Draw the horizontal separator between the content area and the
60 button area below. Defaults to FALSE.
61
62 default_yes => BOOL
63 Autofocus on the "YES" button. Defaults to FALSE.
64
66 OBJECT = new ( OPTIONS | STRING )
67 Create a new Gtk2::Dialog with stock "NO" and "YES" buttons, some
68 text and an optional icon to the left of the text. The icon can be
69 any of the following: a stock-id string, a Gtk2::Image,
70 Gtk2::Gdk::Pixbuf or the full path to an image. Returns a
71 Gtk2::Ex::Dialogs::Question object. In the special case of being
72 passed only one argument, all options are set to defaults and the
73 one argument is used as the text argument. Use of new() is
74 discouraged in favour of ask() or new_and_run().
75
76 RESPONSE = ask ( OPTIONS | STRING ) | new_and_run ( OPTIONS | STRING )
77 Supports all the same arguments as new(). This will create a new
78 Gtk2::Ex::Dialogs::Question, show_all(), run() and return the
79 response of TRUE/'yes' or FALSE/''. Note that ask() is the alias
80 for new_and_run().
81
83 Gtk2::Dialog
84 Gtk2::MessageDialog
85 Gtk2::Ex::Dialogs
86 Gtk2::Ex::Dialogs::ChooseDirectory
87 Gtk2::Ex::Dialogs::ChooseFile
88 Gtk2::Ex::Dialogs::ChoosePreviewFile
89 Gtk2::Ex::Dialogs::ErrorMsg
90 Gtk2::Ex::Dialogs::Message
91
93 Please report any bugs to the mailing list.
94
96 http://opendoorsoftware.com/lists/gtk2-ex-list
97 gtk2-ex-list@opendoorsoftware.com
98
100 Kevin C. Krinke, <kckrinke@opendoorsoftware.com>
101 James Greenhalgh, <jgreenhalgh@opendoorsoftware.com>
102
104 Gtk2::Ex::Dialogs::Question - Provides a simple question dialog.
105 Copyright (C) 2005 Open Door Software Inc. <ods@opendoorsoftware.com>
106
107 This library is free software; you can redistribute it and/or
108 modify it under the terms of the GNU Lesser General Public
109 License as published by the Free Software Foundation; either
110 version 2.1 of the License, or (at your option) any later version.
111
112 This library is distributed in the hope that it will be useful,
113 but WITHOUT ANY WARRANTY; without even the implied warranty of
114 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
115 Lesser General Public License for more details.
116
117 You should have received a copy of the GNU Lesser General Public
118 License along with this library; if not, write to the Free Software
119 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
120
121
122
123perl v5.36.0 2023-01-20 Gtk2::Ex::Dialogs::Question(3)