{"id":7338,"date":"2022-12-20T19:37:44","date_gmt":"2022-12-20T22:37:44","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/cursesuidialogfilebrowser-man3\/"},"modified":"2022-12-20T19:37:44","modified_gmt":"2022-12-20T22:37:44","slug":"cursesuidialogfilebrowser-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/cursesuidialogfilebrowser-man3\/","title":{"rendered":"Curses::UI::Dialog::Filebrowser (man3)"},"content":{"rendered":"<h1 align=\"center\">Curses::UI::Dialog::Filebrowser<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#CLASS HIERARCHY\">CLASS HIERARCHY<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#SPECIAL BINDINGS\">SPECIAL BINDINGS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI::Dialog::Filebrowser \u2212 Create and manipulate filebrowser dialogs<\/p>\n<h2>CLASS HIERARCHY <a name=\"CLASS HIERARCHY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI::Widget <br \/> | <br \/> +\u2212\u2212\u2212\u2212Curses::UI::Container <br \/> | <br \/> +\u2212\u2212\u2212\u2212Curses::UI::Window <br \/> | <br \/> +\u2212\u2212\u2212\u2212Curses::UI::Dialog::Filebrowser<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use Curses::UI; <br \/> my $cui = new Curses::UI; <br \/> my $win = $cui\u2212>add(&#8216;window_id&#8217;, &#8216;Window&#8217;); <br \/> # The hard way. <br \/> # \u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212 <br \/> my $dialog = $win\u2212>add( <br \/> &#8216;mydialog&#8217;, &#8216;Dialog::Filebrowser&#8217; <br \/> ); <br \/> $dialog\u2212>focus; <br \/> my $file = $dialog\u2212>get(); <br \/> $win\u2212>delete(&#8216;mydialog&#8217;); <br \/> # The easy way (see Curses::UI documentation). <br \/> # \u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212\u2212 <br \/> $file = $cui\u2212>filebrowser(); <br \/> $file = $cui\u2212>loadfilebrowser(); <br \/> $file = $cui\u2212>savefilebrowser();<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI::Dialog::Filebrowser is a filebrowser dialog. This type of dialog can be used to select a file, anywhere on the filesystem.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">See exampes\/demo\u2212Curses::UI::Dialog::Filebrowser in the distribution for a short demo.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"23%\">\n<p style=\"margin-top: 1em\"><b>\u2212title<\/b> < <small>TEXT<\/small> ><\/p>\n<\/td>\n<td width=\"60%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Set the title of the dialog window to <small>TEXT.<\/small><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"21%\">\n<p style=\"margin-top: 1em\"><b>\u2212path<\/b> < <small>PATH<\/small> ><\/p>\n<\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Set the path to start with to <small>PATH.<\/small> If this path does not exist, the filebrowser will start in the rootdirectory.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"21%\">\n<p style=\"margin-top: 1em\"><b>\u2212file<\/b> < <small>FILE<\/small> ><\/p>\n<\/td>\n<td width=\"62%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Set the filename to start with to <small>FILE.<\/small><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"38%\">\n<p style=\"margin-top: 1em\"><b>\u2212editfilename<\/b> < <small>BOOLEAN<\/small> ><\/p>\n<\/td>\n<td width=\"45%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If <small>BOOLEAN<\/small> has a true value, the user may edit the filename. This is for example useful for a filebrowser that is used to select a filename to save to. By default this option is set to false.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"37%\">\n<p style=\"margin-top: 1em\"><b>\u2212show_hidden<\/b> < <small>BOOLEAN<\/small> ><\/p>\n<\/td>\n<td width=\"46%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If <small>BOOLEAN<\/small> has a true value, hidden files (the filename starts with a dot) will also be shown. By default this option is set to false.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"28%\">\n<p style=\"margin-top: 1em\"><b>\u2212mask<\/b> < <small>ARRAYREF<\/small> ><\/p>\n<\/td>\n<td width=\"55%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If <b>\u2212mask<\/b> is defined, a filemask popupbox will be added to the filebrowser dialog window. This popupbox will filter the list of files that is displayed, using a regular expression (case insensitive). The <small>ARRAYREF<\/small> contains a list of array references. Each array reference has two elements: a regexp and a description. Here\u2019s an example <b>\u2212mask<\/b>:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">my $mask = [ <br \/> [ &#8216;.&#8217;, &#8216;All files (*)&#8217; ], <br \/> [ &#8216;.txt$&#8217;, &#8216;Text files (*.txt)&#8217; ] <br \/> [ &#8216;howto&#8217;, &#8216;HOWTO documentation&#8217; ], <br \/> [ &#8216;core&#8217;, &#8216;Core files&#8217; ], <br \/> ];<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"37%\">\n<p style=\"margin-top: 1em\"><b>\u2212mask_selected<\/b> < <small>INDEX<\/small> ><\/p>\n<\/td>\n<td width=\"46%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">Normally the first mask in the list of masks will be made active upon creation of the filebrowser. If you want another mask to be active, use the <b>\u2212mask_selected<\/b> option. Set this value to the index of the mask you want to be active. For example: if you would want the &#8220;howto&#8221; mask in the above example to be active, you would use the value 2 for <b>\u2212mask_selected<\/b>.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"25%\">\n<p style=\"margin-top: 1em\"><b>new<\/b> ( <small>OPTIONS<\/small> )<\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"25%\">\n<p><b>layout<\/b> ( )<\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"25%\">\n<p><b>draw<\/b> ( <small>BOOLEAN<\/small> )<\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p>\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"25%\">\n<p><b>focus<\/b> ( )<\/p>\n<\/td>\n<td width=\"58%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">These are standard methods. See Curses::UI::Container for an explanation of these.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"11%\">\n<p style=\"margin-top: 1em\"><b>get<\/b> ( )<\/p>\n<\/td>\n<td width=\"72%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This method will return the complete path to the file that was selected using the filebrowser. If no file was selected, this method will return an undefined value.<\/p>\n<h2>SPECIAL BINDINGS <a name=\"SPECIAL BINDINGS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"9%\">\n<p style=\"margin-top: 1em\"><b>escape<\/b><\/p>\n<\/td>\n<td width=\"74%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">This will invoke the cancel button, so the filebrowser widget returns without selecting any file.<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\">\u2022<\/p>\n<\/td>\n<td width=\"5%\"><\/td>\n<td width=\"1%\">\n<p style=\"margin-top: 1em\"><b>~<\/b><\/p>\n<\/td>\n<td width=\"82%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%; margin-top: 1em\">If the directory\u2212 or filelistbox of the dialog window has the focus and the tilde (~) button is pressed, the filebrowser will chdir to the homedirectory of the current user.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Curses::UI, Curses::UI::Container, Curses::UI::Buttonbox<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright (c) 2001\u22122002 Maurice Makaay. All rights reserved.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Maintained by Marcus Thiesen (marcus@cpan.thiesenweb.de)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This package is free software and is provided &#8220;as is&#8221; without express or implied warranty. It may be used, redistributed and\/or modified under the same terms as perl itself.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Curses::UI::Dialog::Filebrowser \u2212 Create and manipulate filebrowser dialogs <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3656,3007],"class_list":["post-7338","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-cursesuidialogfilebrowser","tag-man3"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=7338"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/7338\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=7338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=7338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=7338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}