Gtk2::Ex::FormFactory::DialogButtons (3)
Leading comments
Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) Standard preamble: ========================================================================
NAME
Gtk2::Ex::FormFactory::DialogButtons - Standard Ok, Apply, Cancel ButtonsSYNOPSIS
Gtk2::Ex::FormFactory::DialogButtons->new ( clicked_hook_before => CODEREF, clicked_hook_after => CODEREF, ... Gtk2::Ex::FormFactory::Container attributes Gtk2::Ex::FormFactory::Widget attributes );
DESCRIPTION
This class implements a typical Ok, Apply, Cancel buttonbox in a Gtk2::Ex::FormFactory framework.If you associate an application object attribute the value needs to be a hash which may contain the keys 'ok', 'apply' and 'cancel' to control the activity of the correspondent buttons. Wheter inactive buttons should be render insensitive or invisible is controlled by the Gtk2::Ex::FormFactory::Widget attribute inactive.
By default the following methods of the associated Gtk2::Ex::FormFactory instance are triggered:
Ok Gtk2::Ex::FormFactory->ok Cancel Gtk2::Ex::FormFactory->cancel Apply Gtk2::Ex::FormFactory->apply
NOTES
No Cancel and Apply buttons are generated if the associated Gtk2::Ex::FormFactory has the sync attribute set. A synchronized FormFactory applies all changes immediately to the underlying objects, so there is no easy way of implementing the Apply and Cancel buttons.You can implement these by your own e.g. by registering a copy of your object to Gtk2::Ex::FormFactory::Context and hook into the button clicks using the clicked_hook_before attribute described beyond.
OBJECT HIERARCHY
Gtk2::Ex::FormFactory::Widget +--- Gtk2::Ex::FormFactory::DialogButtons
ATTRIBUTES
Attributes are handled through the common get_ATTR(), set_ATTR() style accessors, but they are mostly passed once to the object constructor and must not be altered after the associated FormFactory was built.- clicked_hook_before = CODEREF(ok|apply|cancel)
-
Use this callback to hook into the clicked signal handler of the
buttons. Argument is the name of the button actually clicked (``ok'', ``apply''
or ``cancel''). If the callback returns TRUE, Gtk2::Ex::FormFactory's default handler for the button is called afterwards. ReturnFALSEto prevent calling the default handler.
- clicked_hook_after = CODEREF(ok|apply|cancel)
-
This callback is called after the default handler. This is useful
if you want to exit your program cleanly if your main dialog was
closed. First Gtk2::Ex::FormFactory closes the dialog window for you,
doing all necessary cleanup stuff. Afterward you simply call
Gtk2->main_quit to exit the program.
The callback's return value doesn't matter.
For more attributes refer to Gtk2::Ex::FormFactory::Widget.
AUTHORS
Jo.rn Reder <joern at zyn dot de>
COPYRIGHT AND LICENSE
Copyright 2004-2006 by Jo.rn Reder.This library is free software; you can redistribute it and/or modify it under the terms of the
This library is distributed in the hope that it will be useful, but
You should have received a copy of the