~ubuntu-branches/ubuntu/wily/libui-dialog-perl/wily

« back to all changes in this revision

Viewing changes to .pc/FixSpellingAndManDescription.diff/lib/UI/Dialog/Backend/Whiptail.pod

  • Committer: Package Import Robot
  • Author(s): Alejandro Garrido Mota
  • Date: 2013-08-10 17:03:03 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130810170303-z23sxbboezqbjcas
Tags: 1.09-1
* New upstream release. 
* Add watch file.
* d/control:
  - Update Standards-Version to 3.9.4
  - Add Vcs-Git and Vcs-Browser.  
* Add source-format 3.0.
* d/copyright:
  - Update to copyright-format 1.0.
  - Push copyright years.
* Update d/rules to dh.
* Remove docs file.
* Add d/libui-dialog-perl.examples file
* Add FixPod2manErrors.diff and FixSpellingAndManDescription.diff patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
=head1 NAME
 
2
 
 
3
 UI::Dialog::Backend::Whiptail
 
4
 
 
5
=head1 SYNOPSIS
 
6
 
 
7
  use UI::Dialog::Backend::Whiptail;
 
8
  my $d = new UI::Dialog::Backend::Whiptail ( backtitle => 'Demo',
 
9
                                              title => 'Default' );
 
10
 
 
11
  $d->msgbox( title => 'Welcome!', text => 'Welcome one and all!' );
 
12
 
 
13
=head1 ABSTRACT
 
14
 
 
15
UI::Dialog::Backend::Whiptail is the UI::Dialog backend for the Whiptail
 
16
dialog variant. While this module is used through UI::Dialog or any other loader
 
17
module only the compatible methods are ever accessible. However, when using
 
18
this module directly in your application (as in the SYNOPSIS example) you are
 
19
given access to all the options and features of the real whiptail(1) application.
 
20
 
 
21
=head1 DESCRIPTION
 
22
 
 
23
This dialog variant is the staple of the Debian console apt/dpkg interface. There
 
24
isn't very much interesting about this particular backend. This is very much a
 
25
basic dialog variant in comparison to things like Xdialog and cDialog.
 
26
 
 
27
=head1 EXPORT
 
28
 
 
29
=over 2
 
30
 
 
31
 None
 
32
 
 
33
=back
 
34
 
 
35
=head1 INHERITS
 
36
 
 
37
=over 2
 
38
 
 
39
 UI::Dialog::Backend
 
40
 
 
41
=back
 
42
 
 
43
=head1 CONSTRUCTOR
 
44
 
 
45
=head2 new( @options )
 
46
 
 
47
=over 4
 
48
 
 
49
=item EXAMPLE
 
50
 
 
51
=over 6
 
52
 
 
53
 my $d = new( title => 'Default Title', backtitle => 'Backtitle',
 
54
              width => 65, height => 20, listheight => 5 );
 
55
 
 
56
=back
 
57
 
 
58
=item DESCRIPTION
 
59
 
 
60
=over 6
 
61
 
 
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.
 
64
 
 
65
=back
 
66
 
 
67
=item RETURNS
 
68
 
 
69
=over 6
 
70
 
 
71
 A blessed object reference of the UI::Dialog::Backend::Whiptail class.
 
72
 
 
73
=back
 
74
 
 
75
=item OPTIONS
 
76
 
 
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.
 
80
 
 
81
=over 6
 
82
 
 
83
=item B<debug = 0,1,2> (0)
 
84
 
 
85
=item B<literal = 0,1> (0)
 
86
 
 
87
=item B<backtitle = "backtitle"> ('') *
 
88
 
 
89
=item B<title = "title"> ('') *
 
90
 
 
91
=item B<height = \d+> (0) *
 
92
 
 
93
=item B<listheight = \d+> (5) *
 
94
 
 
95
=item B<width = \d+> (0) *
 
96
 
 
97
=item B<beepbefore = 0,1> (0) *
 
98
 
 
99
=item B<beepafter = 0,1> (0) *
 
100
 
 
101
=back
 
102
 
 
103
=back
 
104
 
 
105
=head1 WIDGET METHODS
 
106
 
 
107
=head2 yesno( )
 
108
 
 
109
=over 4
 
110
 
 
111
=item EXAMPLE
 
112
 
 
113
=over 6
 
114
 
 
115
 if ($d->yesno( text => 'A binary type question?') ) {
 
116
     # user pressed yes
 
117
 } else {
 
118
     # user pressed no or cancel
 
119
 }
 
120
 
 
121
=back
 
122
 
 
123
=item DESCRIPTION
 
124
 
 
125
=over 6
 
126
 
 
127
Present the end user with a message box that has two buttons, yes and no.
 
128
 
 
129
=back
 
130
 
 
131
=item RETURNS
 
132
 
 
133
=over 6
 
134
 
 
135
 TRUE (1) for a response of YES or FALSE (0) for anything else.
 
136
 
 
137
=back
 
138
 
 
139
=back
 
140
 
 
141
=head2 msgbox( )
 
142
 
 
143
=over 4
 
144
 
 
145
=item EXAMPLE
 
146
 
 
147
=over 6
 
148
 
 
149
 $d->msgbox( text => 'A simple message' );
 
150
 
 
151
=back
 
152
 
 
153
=item DESCRIPTION
 
154
 
 
155
=over 6
 
156
 
 
157
Pesent the end user with a message box that has an OK button.
 
158
 
 
159
=back
 
160
 
 
161
=item RETURNS
 
162
 
 
163
=over 6
 
164
 
 
165
TRUE (1) for a response of OK or FALSE (0) for anything else.
 
166
 
 
167
=back
 
168
 
 
169
=back
 
170
 
 
171
=head2 infobox( )
 
172
 
 
173
=over 4
 
174
 
 
175
=item EXAMPLE
 
176
 
 
177
=over 6
 
178
 
 
179
 $d->infobox( text => 'A simple 6 second message.', timeout => 6000 );
 
180
 
 
181
=back
 
182
 
 
183
=item DESCRIPTION
 
184
 
 
185
=over 6
 
186
 
 
187
Pesent the end user with a message box for a limited duration of time. The
 
188
timeout is specified in thousandths of a second, ie: 1000 = 1 second.
 
189
 
 
190
=back
 
191
 
 
192
=item RETURNS
 
193
 
 
194
=over 6
 
195
 
 
196
TRUE (1) for a response of OK or FALSE (0) for anything else.
 
197
 
 
198
=back
 
199
 
 
200
=back
 
201
 
 
202
=head2 password( )
 
203
 
 
204
=over 4
 
205
 
 
206
=item EXAMPLE
 
207
 
 
208
=over 6
 
209
 
 
210
 my $string = $d->password( text => 'Enter some (hidden) text.' );
 
211
 
 
212
=back
 
213
 
 
214
=item DESCRIPTION
 
215
 
 
216
=over 6
 
217
 
 
218
Present the end user with a text input field that doesn't reveal the input
 
219
(except to the script) and a message.
 
220
 
 
221
=back
 
222
 
 
223
=item RETURNS
 
224
 
 
225
=over 6
 
226
 
 
227
a SCALAR if the response is OK and FALSE (0) for anything else.
 
228
 
 
229
=back
 
230
 
 
231
=back
 
232
 
 
233
=head2 inputbox( )
 
234
 
 
235
=over 4
 
236
 
 
237
=item EXAMPLE
 
238
 
 
239
=over 6
 
240
 
 
241
 my $string = $d->inputbox( text => 'Enter some text.',
 
242
                            entry => 'this is the input field' );
 
243
 
 
244
=back
 
245
 
 
246
=item DESCRIPTION
 
247
 
 
248
=over 6
 
249
 
 
250
Present the end user with a text input field and a message.
 
251
 
 
252
=back
 
253
 
 
254
=item RETURNS
 
255
 
 
256
=over 6
 
257
 
 
258
a SCALAR if the response is OK and FALSE (0) for anything else.
 
259
 
 
260
=back
 
261
 
 
262
=back
 
263
 
 
264
=head2 textbox( )
 
265
 
 
266
=over 4
 
267
 
 
268
=item EXAMPLE
 
269
 
 
270
=over 6
 
271
 
 
272
 $d->textbox( path => '/path/to/a/text/file' );
 
273
 
 
274
=back
 
275
 
 
276
=item DESCRIPTION
 
277
 
 
278
=over 6
 
279
 
 
280
Present the end user with a simple scrolling box containing the contents
 
281
of the given text file.
 
282
 
 
283
=back
 
284
 
 
285
=item RETURNS
 
286
 
 
287
=over 6
 
288
 
 
289
TRUE (1) if the response is OK and FALSE (0) for anything else.
 
290
 
 
291
=back
 
292
 
 
293
=back
 
294
 
 
295
=head2 menu( )
 
296
 
 
297
=over 4
 
298
 
 
299
=item EXAMPLE
 
300
 
 
301
=over 6
 
302
 
 
303
 my $selection1 = $d->menu( text => 'Select one:',
 
304
                            list => [ 'tag1', 'item1',
 
305
                                      'tag2', 'item2',
 
306
                                      'tag3', 'item3' ]
 
307
                          );
 
308
 
 
309
=back
 
310
 
 
311
=item DESCRIPTION
 
312
 
 
313
=over 6
 
314
 
 
315
Present the user with a selectable list.
 
316
 
 
317
=back
 
318
 
 
319
=item RETURNS
 
320
 
 
321
=over 6
 
322
 
 
323
a SCALAR of the chosen tag if the response is OK and FALSE (0) for
 
324
anything else.
 
325
 
 
326
=back
 
327
 
 
328
=back
 
329
 
 
330
=head2 checklist( )
 
331
 
 
332
=over 4
 
333
 
 
334
=item EXAMPLE
 
335
 
 
336
=over 6
 
337
 
 
338
 my @selection = $d->checklist( text => 'Select one:',
 
339
                                list => [ 'tag1', [ 'item1', 0 ],
 
340
                                          'tag2', [ 'item2', 1 ],
 
341
                                          'tag3', [ 'item3', 1 ] ]
 
342
                              );
 
343
 
 
344
=back
 
345
 
 
346
=item DESCRIPTION
 
347
 
 
348
=over 6
 
349
 
 
350
Present the user with a selectable checklist.
 
351
 
 
352
=back
 
353
 
 
354
=item RETURNS
 
355
 
 
356
=over 6
 
357
 
 
358
an ARRAY of the chosen tags if the response is OK and FALSE (0) for
 
359
anything else.
 
360
 
 
361
=back
 
362
 
 
363
=back
 
364
 
 
365
=head2 radiolist( )
 
366
 
 
367
=over 4
 
368
 
 
369
=item EXAMPLE
 
370
 
 
371
=over 6
 
372
 
 
373
 my $selection = $d->radiolist( text => 'Select one:',
 
374
                                list => [ 'tag1', [ 'item1', 0 ],
 
375
                                          'tag2', [ 'item2', 1 ],
 
376
                                          'tag3', [ 'item3', 0 ] ]
 
377
                              );
 
378
 
 
379
=back
 
380
 
 
381
=item DESCRIPTION
 
382
 
 
383
=over 6
 
384
 
 
385
Present the user with a selectable radiolist.
 
386
 
 
387
=back
 
388
 
 
389
=item RETURNS
 
390
 
 
391
=over 6
 
392
 
 
393
a SCALAR of the chosen tag if the response is OK and FALSE (0) for
 
394
anything else.
 
395
 
 
396
=back
 
397
 
 
398
=back
 
399
 
 
400
=head2 fselect( )
 
401
 
 
402
=over 4
 
403
 
 
404
=item EXAMPLE
 
405
 
 
406
=over 6
 
407
 
 
408
 my $text = $d->fselect( path => '/path/to/a/file/or/directory' );
 
409
 
 
410
=back
 
411
 
 
412
=item DESCRIPTION
 
413
 
 
414
=over 6
 
415
 
 
416
Present the user with a file selection widget preset with the given path.
 
417
 
 
418
=back
 
419
 
 
420
=item RETURNS
 
421
 
 
422
=over 6
 
423
 
 
424
a SCALAR if the response is OK and FALSE (0) for anything else.
 
425
 
 
426
=back
 
427
 
 
428
=back
 
429
 
 
430
=head2 dselect( )
 
431
 
 
432
=over 4
 
433
 
 
434
=item EXAMPLE
 
435
 
 
436
=over 6
 
437
 
 
438
 my $text = $d->dselect( path => '/path/to/a/directory' );
 
439
 
 
440
=back
 
441
 
 
442
=item DESCRIPTION
 
443
 
 
444
=over 6
 
445
 
 
446
Present the user with a file selection widget preset with the given path.
 
447
Unlike fselect() this widget will only return a directory selection.
 
448
 
 
449
=back
 
450
 
 
451
=item RETURNS
 
452
 
 
453
=over 6
 
454
 
 
455
a SCALAR if the response is OK and FALSE (0) for anything else.
 
456
 
 
457
=back
 
458
 
 
459
=back
 
460
 
 
461
=head2 gauge_start( )
 
462
 
 
463
=over 4
 
464
 
 
465
=item EXAMPLE
 
466
 
 
467
=over 6
 
468
 
 
469
 $d->gauge_start( text => 'gauge...', percentage => 1 );
 
470
 
 
471
=back
 
472
 
 
473
=item DESCRIPTION
 
474
 
 
475
=over 6
 
476
 
 
477
Display a meter bar to the user. This get's the widget realized but requires
 
478
the use of the other gauge_*() methods for functionality.
 
479
 
 
480
=back
 
481
 
 
482
=item RETURNS
 
483
 
 
484
=over 6
 
485
 
 
486
TRUE (1) if the widget loaded fine and FALSE (0) for anything else.
 
487
 
 
488
=back
 
489
 
 
490
=back
 
491
 
 
492
=head2 gauge_inc( )
 
493
 
 
494
=over 4
 
495
 
 
496
=item EXAMPLE
 
497
 
 
498
=over 6
 
499
 
 
500
 $d->gauge_inc( 1 );
 
501
 
 
502
=back
 
503
 
 
504
=item DESCRIPTION
 
505
 
 
506
=over 6
 
507
 
 
508
Increment the meter by the given amount.
 
509
 
 
510
=back
 
511
 
 
512
=item RETURNS
 
513
 
 
514
=over 6
 
515
 
 
516
TRUE (1) if the widget incremented fine and FALSE (0) for anything else.
 
517
 
 
518
=back
 
519
 
 
520
=back
 
521
 
 
522
=head2 gauge_dec( )
 
523
 
 
524
=over 4
 
525
 
 
526
=item EXAMPLE
 
527
 
 
528
=over 6
 
529
 
 
530
 $d->gauge_dec( 1 );
 
531
 
 
532
=back
 
533
 
 
534
=item DESCRIPTION
 
535
 
 
536
=over 6
 
537
 
 
538
Decrement the meter by the given amount.
 
539
 
 
540
=back
 
541
 
 
542
=item RETURNS
 
543
 
 
544
=over 6
 
545
 
 
546
TRUE (1) if the widget incremented fine and FALSE (0) for anything else.
 
547
 
 
548
=back
 
549
 
 
550
=back
 
551
 
 
552
=head2 gauge_set( )
 
553
 
 
554
=over 4
 
555
 
 
556
=item EXAMPLE
 
557
 
 
558
=over 6
 
559
 
 
560
 $d->gauge_set( 99 );
 
561
 
 
562
=back
 
563
 
 
564
=item DESCRIPTION
 
565
 
 
566
=over 6
 
567
 
 
568
Set the meter bar to the given amount.
 
569
 
 
570
=back
 
571
 
 
572
=item RETURNS
 
573
 
 
574
=over 6
 
575
 
 
576
TRUE (1) if the widget set fine and FALSE (0) for anything else.
 
577
 
 
578
=back
 
579
 
 
580
=back
 
581
 
 
582
=head2 gauge_text( )
 
583
 
 
584
=over 4
 
585
 
 
586
=item EXAMPLE
 
587
 
 
588
=over 6
 
589
 
 
590
 $d->gauge_text( 'string' );
 
591
 
 
592
=back
 
593
 
 
594
=item DESCRIPTION
 
595
 
 
596
=over 6
 
597
 
 
598
Set the meter bar message to the given string.
 
599
 
 
600
=back
 
601
 
 
602
=item RETURNS
 
603
 
 
604
=over 6
 
605
 
 
606
TRUE (1) if the widget set fine and FALSE (0) for anything else.
 
607
 
 
608
=back
 
609
 
 
610
=back
 
611
 
 
612
=head2 gauge_stop( )
 
613
 
 
614
=over 4
 
615
 
 
616
=item EXAMPLE
 
617
 
 
618
=over 6
 
619
 
 
620
 $d->gauge_stop();
 
621
 
 
622
=back
 
623
 
 
624
=item DESCRIPTION
 
625
 
 
626
=over 6
 
627
 
 
628
End the meter bar widget process.
 
629
 
 
630
=back
 
631
 
 
632
=item RETURNS
 
633
 
 
634
=over 6
 
635
 
 
636
TRUE (1) if the widget closed fine and FALSE (0) for anything else.
 
637
 
 
638
=back
 
639
 
 
640
=back
 
641
 
 
642
=head1 SEE ALSO
 
643
 
 
644
=over 2
 
645
 
 
646
=item PERLDOC
 
647
 
 
648
 UI::Dialog
 
649
 UI::Dialog::Console
 
650
 UI::Dialog::Backend
 
651
 
 
652
=back
 
653
 
 
654
=over 2
 
655
 
 
656
=item MAN FILES
 
657
 
 
658
 whiptail(1)
 
659
 
 
660
=back
 
661
 
 
662
=head1 BUGS
 
663
 
 
664
 Please email the author with any bug reports. Include the name of the
 
665
 module in the subject line.
 
666
 
 
667
=head1 AUTHOR
 
668
 
 
669
 Kevin C. Krinke, E<lt>kevin@krinke.caE<gt> 
 
670
 
 
671
=head1 COPYRIGHT AND LICENSE
 
672
 
 
673
 Copyright (C) 2013  Kevin C. Krinke <kevin@krinke.ca>
 
674
 
 
675
 This library is free software; you can redistribute it and/or
 
676
 modify it under the terms of the GNU Lesser General Public
 
677
 License as published by the Free Software Foundation; either
 
678
 version 2.1 of the License, or (at your option) any later version.
 
679
 
 
680
 This library is distributed in the hope that it will be useful,
 
681
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
682
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
683
 Lesser General Public License for more details.
 
684
 
 
685
 You should have received a copy of the GNU Lesser General Public
 
686
 License along with this library; if not, write to the Free Software
 
687
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
688
 
 
689
=cut