1Gtk2::Ex::Dialogs(3) User Contributed Perl Documentation Gtk2::Ex::Dialogs(3)
2
3
4
6 Gtk2::Ex::Dialogs - Useful tools for Gnome2/Gtk2 Perl GUI design.
7
9 use Gtk2::Ex::Dialogs ( 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->set_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
25 # now popup a new dialog ( blocking the main loop if there is one )
26 new_and_run
27 Gtk2::Ex::Dialogs::Message ( title => "Dialog Title",
28 text => "This is a simple message" );
29
30 # now popup a new dialog ( blocking the main loop if there is one )
31 new_and_run
32 Gtk2::Ex::Dialogs::ErrorMsg ( "Simple error message." );
33
35 This module provides the Gtk2::Ex::Dialogs::Message,
36 Gtk2::Ex::Dialogs::ErrorMsg and Gtk2::Ex::Dialogs::Question classes to
37 the main application while setting the initial defaults to those
38 specified upon using Gtk2::Ex::Dialogs.
39
41 Gtk2::Ex::Dialogs supports the following options:
42
43 title => STRING
44 The title of the dialog window. Defaults to an empty string.
45
46 text => STRING
47 The text to be displayed. This is the core purpose of the module
48 and is the only mandatory argument.
49
50 icon => /path/to/image || stock-id || Gtk2::Gdk::Pixbuf || Gtk2::Image
51 The dialog-sized image to place to the left of the text. Note:
52 there are five aliased stock-ids which correspond to the five
53 gtk-dialog-* ids, "warning", "question", "info", "error" and
54 "authentication". Defaults to the stock-id "gtk-dialog-question".
55
56 parent_window => Gtk2::Window
57 Reference to the main application window.
58
59 destroy_with_parent => BOOL
60 When the parent_window is destroyed, what do we do? Defaults to
61 FALSE.
62
63 modal => BOOL
64 Does this message make the parent_window freeze while the message
65 exists. Defaults to FALSE.
66
67 no_separator => BOOL
68 Draw the horizontal separator between the content area and the
69 button area below. Defaults to FALSE.
70
71 default_yes => BOOL
72 Autofocus on the "YES" button. Defaults to FALSE.
73
74 must_exist => BOOL
75 The end-user must supply a path to an existing file or directory.
76 Should the end-user provide a non-existant path, the dialog will be
77 respawned until an existing file is chosen. Defaults to FALSE.
78
80 This module provides a "set_" function for all options that takes a
81 signle argument that is then used as the default for all three modules
82 Gtk2::Ex::Dialogs::Message, Gtk2::Ex::Dialogs::ErrorMsg and
83 Gtk2::Ex::Dialogs::Question. For clarity, the function names are as
84 follows:
85
86 Gtk2::Ex::Dialogs->set_title
87 Gtk2::Ex::Dialogs->set_text
88 Gtk2::Ex::Dialogs->set_icon
89 Gtk2::Ex::Dialogs->set_modal
90 Gtk2::Ex::Dialogs->set_parent_window
91 Gtk2::Ex::Dialogs->set_destroy_with_parent
92 Gtk2::Ex::Dialogs->set_default_yes
93 Gtk2::Ex::Dialogs->set_must_exist
94
96 Gtk2::Dialog
97 Gtk2::MessageDialog
98 Gtk2::Ex::Dialogs::ChooseDirectory
99 Gtk2::Ex::Dialogs::ChooseFile
100 Gtk2::Ex::Dialogs::ChoosePreviewFile
101 Gtk2::Ex::Dialogs::Message
102 Gtk2::Ex::Dialogs::ErrorMsg
103 Gtk2::Ex::Dialogs::Question
104
106 Please report any bugs to the mailing list.
107
109 http://odsgnulinux.com/lists/gtk2-ex-list
110 gtk2-ex-list@odsgnulinux.com
111
113 Kevin C. Krinke, <kckrinke@opendoorsoftware.com>
114 James Greenhalgh, <jgreenhalgh@opendoorsoftware.com>
115
117 Gtk2::Ex::Dialogs - Useful tools for Gnome2/Gtk2 Perl GUI design.
118 Copyright (C) 2005 Open Door Software Inc. <ods@opendoorsoftware.com>
119
120 This library is free software; you can redistribute it and/or
121 modify it under the terms of the GNU Lesser General Public
122 License as published by the Free Software Foundation; either
123 version 2.1 of the License, or (at your option) any later version.
124
125 This library is distributed in the hope that it will be useful,
126 but WITHOUT ANY WARRANTY; without even the implied warranty of
127 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
128 Lesser General Public License for more details.
129
130 You should have received a copy of the GNU Lesser General Public
131 License along with this library; if not, write to the Free Software
132 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
133
134
135
136perl v5.32.0 2020-07-28 Gtk2::Ex::Dialogs(3)