1Curses::UI::Dialog::FilUesberrowCsoenrt(r3i)buted Perl DCoucrusmeesn:t:aUtIi:o:nDialog::Filebrowser(3)
2
3
4
6 Curses::UI::Dialog::Filebrowser - Create and manipulate filebrowser
7 dialogs
8
10 Curses::UI::Widget
11 |
12 +----Curses::UI::Container
13 |
14 +----Curses::UI::Window
15 |
16 +----Curses::UI::Dialog::Filebrowser
17
19 use Curses::UI;
20 my $cui = new Curses::UI;
21 my $win = $cui->add('window_id', 'Window');
22
23 # The hard way.
24 # -------------
25 my $dialog = $win->add(
26 'mydialog', 'Dialog::Filebrowser'
27 );
28 $dialog->focus;
29 my $file = $dialog->get();
30 $win->delete('mydialog');
31
32 # The easy way (see Curses::UI documentation).
33 # --------------------------------------------
34 $file = $cui->filebrowser();
35 $file = $cui->loadfilebrowser();
36 $file = $cui->savefilebrowser();
37
39 Curses::UI::Dialog::Filebrowser is a filebrowser dialog. This type of
40 dialog can be used to select a file, anywhere on the filesystem.
41
42 See exampes/demo-Curses::UI::Dialog::Filebrowser in the distribution
43 for a short demo.
44
46 · -title < TEXT >
47
48 Set the title of the dialog window to TEXT.
49
50 · -path < PATH >
51
52 Set the path to start with to PATH. If this path does not exist,
53 the filebrowser will start in the rootdirectory.
54
55 · -file < FILE >
56
57 Set the filename to start with to FILE.
58
59 · -editfilename < BOOLEAN >
60
61 If BOOLEAN has a true value, the user may edit the filename. This
62 is for example useful for a filebrowser that is used to select a
63 filename to save to. By default this option is set to false.
64
65 · -show_hidden < BOOLEAN >
66
67 If BOOLEAN has a true value, hidden files (the filename starts with
68 a dot) will also be shown. By default this option is set to false.
69
70 · -mask < ARRAYREF >
71
72 If -mask is defined, a filemask popupbox will be added to the
73 filebrowser dialog window. This popupbox will filter the list of
74 files that is displayed, using a regular expression (case
75 insensitive). The ARRAYREF contains a list of array references.
76 Each array reference has two elements: a regexp and a description.
77 Here's an example -mask:
78
79 my $mask = [
80 [ '.', 'All files (*)' ],
81 [ '\.txt$', 'Text files (*.txt)' ]
82 [ 'howto', 'HOWTO documentation' ],
83 [ 'core', 'Core files' ],
84 ];
85
86 · -mask_selected < INDEX >
87
88 Normally the first mask in the list of masks will be made active
89 upon creation of the filebrowser. If you want another mask to be
90 active, use the -mask_selected option. Set this value to the index
91 of the mask you want to be active. For example: if you would want
92 the "howto" mask in the above example to be active, you would use
93 the value 2 for -mask_selected.
94
96 · new ( OPTIONS )
97
98 · layout ( )
99
100 · draw ( BOOLEAN )
101
102 · focus ( )
103
104 These are standard methods. See Curses::UI::Container for an
105 explanation of these.
106
107 · get ( )
108
109 This method will return the complete path to the file that was
110 selected using the filebrowser. If no file was selected, this
111 method will return an undefined value.
112
114 · escape
115
116 This will invoke the cancel button, so the filebrowser widget
117 returns without selecting any file.
118
119 · ~
120
121 If the directory- or filelistbox of the dialog window has the focus
122 and the tilde (~) button is pressed, the filebrowser will chdir to
123 the homedirectory of the current user.
124
126 Curses::UI, Curses::UI::Container, Curses::UI::Buttonbox
127
129 Copyright (c) 2001-2002 Maurice Makaay. All rights reserved.
130
131 Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)
132
133 This package is free software and is provided "as is" without express
134 or implied warranty. It may be used, redistributed and/or modified
135 under the same terms as perl itself.
136
137
138
139perl v5.28.0 2011-09-01Curses::UI::Dialog::Filebrowser(3)