Gtk2::Ex::Dialogs::Question - Provides a simple question dialog.


Gtk2-Ex-Dialogs documentation  | view source Contained in the Gtk2-Ex-Dialogs distribution.

Index


NAME

Top

Gtk2::Ex::Dialogs::Question - Provides a simple question dialog.

SYNOPSIS

Top

 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
 }

DESCRIPTION

Top

This module provides a simple dialog api that wraps Gtk2::Dialog objectively. The objective is a clean and simple question dialog (just "NO" and "YES" buttons).

OPTIONS

Top

All public methods (and the entire class) support the following options:

title => STRING

The title of the dialog window. Defaults to an empty string.

text => STRING

The text to be displayed. This is the core purpose of the module and is the only mandatory argument.

icon => /path/to/image || stock-id || Gtk2::Gdk::Pixbuf || Gtk2::Image

The dialog-sized image to place to the left of the text. Note: there are five aliased stock-ids which correspond to the five gtk-dialog-* ids, "warning", "question", "info", "error" and "authentication". Defaults to the stock-id "gtk-dialog-question".

parent_window => Gtk2::Window

Reference to the main application window.

destroy_with_parent => BOOL

When the parent_window is destroyed, what do we do? Defaults to FALSE.

modal => BOOL

Does this message make the parent_window freeze while the message exists. Defaults to FALSE.

no_separator => BOOL

Draw the horizontal separator between the content area and the button area below. Defaults to FALSE.

default_yes => BOOL

Autofocus on the "YES" button. Defaults to FALSE.

PUBLIC METHODS

Top

OBJECT = new ( OPTIONS | STRING )

Create 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 the following: a stock-id string, a Gtk2::Image, Gtk2::Gdk::Pixbuf or the full path to an image. Returns a Gtk2::Ex::Dialogs::Question object. In the special case of being passed only one argument, all options are set to defaults and the one argument is used as the text argument. Use of new() is discouraged in favour of ask() or new_and_run().

RESPONSE = ask ( OPTIONS | STRING ) | new_and_run ( OPTIONS | STRING )

Supports all the same arguments as new(). This will create a new Gtk2::Ex::Dialogs::Question, show_all(), run() and return the response of TRUE/'yes' or FALSE/''. Note that ask() is the alias for new_and_run().

SEE ALSO

Top

 Gtk2::Dialog
 Gtk2::MessageDialog
 Gtk2::Ex::Dialogs
 Gtk2::Ex::Dialogs::ChooseDirectory
 Gtk2::Ex::Dialogs::ChooseFile
 Gtk2::Ex::Dialogs::ChoosePreviewFile
 Gtk2::Ex::Dialogs::ErrorMsg
 Gtk2::Ex::Dialogs::Message




BUGS

Top

Please report any bugs to the mailing list.

MAILING LIST

Top

 http://opendoorsoftware.com/lists/gtk2-ex-list
 gtk2-ex-list@opendoorsoftware.com

AUTHORS

Top

 Kevin C. Krinke, <kckrinke@opendoorsoftware.com>
 James Greenhalgh, <jgreenhalgh@opendoorsoftware.com>

COPYRIGHT AND LICENSE

Top


Gtk2-Ex-Dialogs documentation  | view source Contained in the Gtk2-Ex-Dialogs distribution.