3
UI::Dialog::Backend::Zenity
7
use UI::Dialog::Backend::Zenity;
8
my $d = new UI::Dialog::Backend::Zenity ( backtitle => 'Demo',
11
$d->msgbox( title => 'Welcome!', text => 'Welcome one and all!' );
15
Zenity is the speedy, slick, and ultimately cool GTK2 dialog variant that is
16
destined to obselete the current GNOME dialog variant; GDialog. This is an
17
OOPerl wrapper of the Zenity application.
21
UI::Dialog::Backend::Zenity is the UI::Dialog backend for the new GNOME
22
dialog variant. While this module is used through UI::Dialog or any other loader
23
module only the compatible methods are ever accessible. However, when using
24
this module directly in your application (as in the SYNOPSIS example) you are
25
given access to all the options and features of the real zenity(1) application.
45
=head2 new( @options )
53
my $d = new( title => 'Default Title', backtitle => 'Backtitle',
54
width => 65, height => 20, listheight => 5 );
62
This is the Class Constructor method. It accepts a list of key => value pairs
63
and uses them as the defaults when interacting with the various widgets.
71
A blessed object reference of the UI::Dialog::Backend::Zenity class.
77
The (...)'s after each option indicate the default for the option. An * denotes
78
support by all the widget methods on a per-use policy defaulting to the values
79
decided during object creation.
83
=item B<debug = 0,1,2> (0)
85
=item B<literal = 0,1> (0)
87
=item B<backtitle = "backtitle"> ('') *
89
=item B<title = "title"> ('') *
91
=item B<height = \d+> (0) *
93
=item B<width = \d+> (0) *
95
=item B<display = ":0"> ('') *
97
=item B<name = "wmname"> ('') *
99
=item B<class = "wmclass"> ('') *
101
=item B<beepbin = "/usr/bin/beep"> ('')
103
=item B<beepbefore = 0,1> (0) *
105
=item B<beepafter = 0,1> (0) *
111
=head1 WIDGET METHODS
113
=head2 yesno( ) question( )
121
if ($d->yesno( text => 'A binary type question?') ) {
124
# user pressed no or cancel
133
Present the end user with a message box that has two buttons, OK and CANCEL
134
(aka: Yes and No). yesno() is a wrapper for question().
142
TRUE (1) for a response of YES or FALSE (0) for anything else.
156
$d->msgbox( text => 'A simple message' );
164
Pesent the end user with a message box that has an OK button.
172
TRUE (1) for a response of OK or FALSE (0) for anything else.
186
my $string = $d->password( text => 'Enter some (hidden) text.' );
194
Present the end user with a text input field that doesn't reveal the input
195
(except to the script) and a message.
203
a SCALAR if the response is OK and FALSE (0) for anything else.
217
my $string = $d->inputbox( text => 'Please enter some text...',
218
entry => 'this is the input field' );
226
Present the end user with a text input field and a message.
234
a SCALAR if the response is OK and FALSE (0) for anything else.
248
$d->textbox( path => '/path/to/a/text/file' );
256
Present the end user with a simple scrolling box containing the contents
257
of the given text file.
265
TRUE (1) if the response is OK and FALSE (0) for anything else.
279
$d->editbox( path => '/path/to/a/text/file' );
287
Present the end user with an editable textbox containing the contents
288
of the given text file.
296
A SCALAR containing the edited text if the response is OK and FALSE (0)
311
my $selection1 = $d->menu( text => 'Select one:',
312
list => [ 'tag1', 'item1',
322
Present the user with a selectable list.
330
a SCALAR of the chosen tag if the response is OK and FALSE (0) for
345
my @selection = $d->checklist( text => 'Select one:',
346
list => [ 'tag1', [ 'item1', 0 ],
347
'tag2', [ 'item2', 1 ],
348
'tag3', [ 'item3', 1 ] ]
357
Present the user with a selectable checklist.
365
an ARRAY of the chosen tags if the response is OK and FALSE (0) for
380
my $selection = $d->radiolist( text => 'Select one:',
381
list => [ 'tag1', [ 'item1', 0 ],
382
'tag2', [ 'item2', 1 ],
383
'tag3', [ 'item3', 0 ] ]
392
Present the user with a selectable radiolist.
400
a SCALAR of the chosen tag if the response is OK and FALSE (0) for
415
my $text = $d->fselect( path => '/path/to/a/file/or/directory' );
423
Present the user with a file selection widget preset with the given path.
431
a SCALAR if the response is OK and FALSE (0) for anything else.
445
my $text = $d->dselect( path => '/path/to/a/directory' );
453
Present the user with a file selection widget preset with the given path.
454
Unlike fselect() this widget will only return a directory selection.
462
a SCALAR if the response is OK and FALSE (0) for anything else.
476
my $date = $d->calendar( day => 10, month => 10, year => 1977,
477
'date-format' => '%d/%m/%y' );
485
Present the user with a calendar so that they may select a date. The
486
'date-format' option follows the same format definition as the date(1)
487
command line program. If the day, month and year options are not provided,
488
the widget defaults to the current date. The default format for the
489
date string is '%d/%m/%y' which breaks down to: "dd/mm/yy".
497
a SCALAR if the response is OK and FALSE (0) for anything else.
503
=head2 gauge_start( )
511
$d->gauge_start( text => 'gauge...', percentage => 1 );
519
Display a meter bar to the user. This get's the widget realized but requires
520
the use of the other gauge_*() methods for functionality.
528
TRUE (1) if the widget loaded fine and FALSE (0) for anything else.
550
Increment the meter by the given amount.
558
TRUE (1) if the widget incremented fine and FALSE (0) for anything else.
580
Decrement the meter by the given amount.
588
TRUE (1) if the widget incremented fine and FALSE (0) for anything else.
610
Set the meter bar to the given amount.
618
TRUE (1) if the widget set fine and FALSE (0) for anything else.
640
End the meter bar widget process.
648
TRUE (1) if the widget closed fine and FALSE (0) for anything else.
663
UI::Dialog::Backend::Nautilus
664
UI::Dialog::Backend::XOSD
678
Please email the author with any bug reports. Include the name of the
679
module in the subject line.
683
Kevin C. Krinke, E<lt>kevin@krinke.caE<gt>
685
=head1 COPYRIGHT AND LICENSE
687
Copyright (C) 2013 Kevin C. Krinke <kevin@krinke.ca>
689
This library is free software; you can redistribute it and/or
690
modify it under the terms of the GNU Lesser General Public
691
License as published by the Free Software Foundation; either
692
version 2.1 of the License, or (at your option) any later version.
694
This library is distributed in the hope that it will be useful,
695
but WITHOUT ANY WARRANTY; without even the implied warranty of
696
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
697
Lesser General Public License for more details.
699
You should have received a copy of the GNU Lesser General Public
700
License along with this library; if not, write to the Free Software
701
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA