1Gtk2::Ex::FormFactory::UDsiearloCgoBnuttrtiobnust(e3d)PGetrkl2:D:oEcxu:m:eFnotramtFiaocntory::DialogButtons(3)
2
3
4
6 Gtk2::Ex::FormFactory::DialogButtons - Standard Ok, Apply, Cancel
7 Buttons
8
10 Gtk2::Ex::FormFactory::DialogButtons->new (
11 clicked_hook_before => CODEREF,
12 clicked_hook_after => CODEREF,
13 ...
14 Gtk2::Ex::FormFactory::Container attributes
15 Gtk2::Ex::FormFactory::Widget attributes
16 );
17
19 This class implements a typical Ok, Apply, Cancel buttonbox in a
20 Gtk2::Ex::FormFactory framework.
21
22 If you associate an application object attribute the value needs to be
23 a hash which may contain the keys 'ok', 'apply' and 'cancel' to control
24 the activity of the correspondent buttons. Wheter inactive buttons
25 should be render insensitive or invisible is controlled by the
26 Gtk2::Ex::FormFactory::Widget attribute inactive.
27
28 By default the following methods of the associated
29 Gtk2::Ex::FormFactory instance are triggered:
30
31 Ok Gtk2::Ex::FormFactory->ok
32 Cancel Gtk2::Ex::FormFactory->cancel
33 Apply Gtk2::Ex::FormFactory->apply
34
36 No Cancel and Apply buttons are generated if the associated
37 Gtk2::Ex::FormFactory has the sync attribute set. A synchronized
38 FormFactory applies all changes immediately to the underlying objects,
39 so there is no easy way of implementing the Apply and Cancel buttons.
40
41 You can implement these by your own e.g. by registering a copy of your
42 object to Gtk2::Ex::FormFactory::Context and hook into the button
43 clicks using the clicked_hook_before attribute described beyond.
44
46 Gtk2::Ex::FormFactory::Widget
47 +--- Gtk2::Ex::FormFactory::DialogButtons
48
50 Attributes are handled through the common get_ATTR(), set_ATTR() style
51 accessors, but they are mostly passed once to the object constructor
52 and must not be altered after the associated FormFactory was built.
53
54 clicked_hook_before = CODEREF("ok"|"apply"|"cancel")
55 Use this callback to hook into the clicked signal handler of the
56 buttons. Argument is the name of the button actually clicked ("ok",
57 "apply" or "cancel"). If the callback returns TRUE,
58 Gtk2::Ex::FormFactory's default handler for the button is called
59 afterwards. Return FALSE to prevent calling the default handler.
60
61 clicked_hook_after = CODEREF("ok"|"apply"|"cancel")
62 This callback is called after the default handler. This is useful
63 if you want to exit your program cleanly if your main dialog was
64 closed. First Gtk2::Ex::FormFactory closes the dialog window for
65 you, doing all necessary cleanup stuff. Afterward you simply call
66 Gtk2->main_quit to exit the program.
67
68 The callback's return value doesn't matter.
69
70 For more attributes refer to Gtk2::Ex::FormFactory::Widget.
71
73 Jörn Reder <joern at zyn dot de>
74
76 Copyright 2004-2006 by Jörn Reder.
77
78 This library is free software; you can redistribute it and/or modify it
79 under the terms of the GNU Library General Public License as published
80 by the Free Software Foundation; either version 2.1 of the License, or
81 (at your option) any later version.
82
83 This library is distributed in the hope that it will be useful, but
84 WITHOUT ANY WARRANTY; without even the implied warranty of
85 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 Library General Public License for more details.
87
88 You should have received a copy of the GNU Library General Public
89 License along with this library; if not, write to the Free Software
90 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307
91 USA.
92
94 Hey! The above document had some coding errors, which are explained
95 below:
96
97 Around line 213:
98 Non-ASCII character seen before =encoding in 'Jörn'. Assuming UTF-8
99
100
101
102perl v5.28.1 2006-0G2t-k227::Ex::FormFactory::DialogButtons(3)