Prima::...leDialog(3)
π NAME
okay so this is the Prima::...leDialog(3) page (user contributed Perl documentation, iykyk), and the actual icon of the show is Prima::Dialog::FileDialog β file system-related widgets and dialogs. periodt. β¨
β¨ SYNOPSIS
bestie, hereβs the whole vibe in code, no cap:
# open file
use Prima qw(Application Dialog::FileDialog);
my $open = Prima::Dialog::OpenDialog-> new(
filter => [
['Perl modules' => '*.pm'],
['All' => '*']
]
);
print $open-> fileName, " is to be opened\n" if $open-> execute;
# save file
my $save = Prima::Dialog::SaveDialog-> new(
fileName => $open-> fileName,
);
print $save-> fileName, " is to be saved\n" if $save-> execute;
# open several files
$open-> multiSelect(1);
print $open-> fileName, " are to be opened\n" if $open-> execute;
π¦ DESCRIPTION
the module contains standard open file, save file, and change directory dialogs, plus special widgets for file and drive selection that are used in the dialogs. literally the file-system toolkit of your dreams π
πΈ Prima::DirectoryListBox
a directory list box, bestie. shows the list of subdirectories. itβs giving hierarchy realness π
πΈ Properties
closedGlyphsINTEGERβ the number of horizontal equal-width images contained in theclosedIconproperty. Default value:1.closedIconICONβ provides the icon for the directories contained in the current directory.indentINTEGERβ a positive integer number of pixels, the offset of the hierarchy outline. Default value:12.openedGlyphsINTEGERβ the number of horizontal equal-width images contained in theopenedIconproperty. Default value:1.openedIconOBJECTβ provides the icon for the directories contained above the current directory.pathSTRINGβ runtime-only property. selects the file path.showDotDirsBOOLEANβ selects if the directories with the first dot character are shown. the dot-prefixed files are traditionally hidden in unix, so under Windows, this property is not useful. Default value:1.
πΈ Methods
filesFILE_TYPEβ returns the list of files filtered byFILE_TYPE. theFILE_TYPEis a string, one of those returned byPrima::Utils::getdir( seegetdirin Prima::Utils.
π Prima::DriveComboBox
drive selector combo-box for non-unix systems ππ¨
π Properties
firstDriveDRIVE_LETTERβ create-only property. Default value:'A:'.DRIVE_LETTERcan be set to another value to start the drive enumeration. some OSes can probe eventual diskette drives inside the drive enumeration routines, so it might be reasonable to setDRIVE_LETTERto the"C:"string for responsiveness increase.driveDRIVE_LETTERβ selects the drive letter. Default value:'C:'.
π Prima::Dialog::FileDialog
provides the standard file dialog where the user can navigate in the file system and select one or many files. the class can operate in two modes β 'open' and 'save'; these modes are triggered internally by Prima::Dialog::OpenDialog and Prima::Dialog::SaveDialog. some properties behave differently depending on the mode that is stored in the openMode property. main character energy for real π
π Properties
createPromptBOOLEANβ if1, and the selected file is nonexistent, asks the user if the file is to be created. only actual whenopenModeis1. Default value:0.defaultExtSTRINGβ selects the file extension, appended to the file name typed by the user, if the extension is not given. Default value:''.directorySTRINGβ selects the currently selected directory.fileMustExistBOOLEANβ if1, ensures that the file typed by the user exists before closing the dialog. Default value:1.fileNameSTRING, ...β for the single-file selection, assigns the selected file name. for the multiple-file selection, on get-calls returns a list of the selected files; on set-calls accepts a single string where the file names are separated by the space character. the eventual space characters must be quoted.filterARRAYβ contains an array of arrays of string pairs, where each pair describes a file type. the first scalar in the pair is the description of the type; the second is a file mask. Default value:"[[ 'All files' => '*']]".filterIndexINTEGERβ selects the index in thefilterarray, which is the currently selected file type.multiSelectBOOLEANβ selects whether the user can select several (1) or one (0) file. see also:fileName.noReadOnlyBOOLEANβ if1, fails to open a file when it is read-only. Default value:0. only actual whenopenModeis0.noTestFileCreateBOOLEANβ if0, tests if a file that the user selected can be created. Default value:0. only actual whenopenModeis0.overwritePromptBOOLEANβ if1, asks the user if the file selected is to be overwritten. Default value:1. only actual whenopenModeis0.openModeBOOLEANβ create-only property. selects whether the dialog operates in'open'(1) mode or'save'(0) mode.pathMustExistBOOLEANβ if1, ensures that the path typed by the user exists before closing the dialog. Default value:1.showDotFilesBOOLEANβ selects if the directories with the first dot character are shown. Default value:0.showHelpBOOLEANβ a create-only property. if1, the'Help'button is inserted in the dialog. Default value:0.sortedBOOLEANβ selects whether the file list appears sorted by name (1) or not (0). Default value :1.systemBOOLEANβ a create-only property. if set to1,Prima::Dialog::FileDialogreturns an instance of thePrima::sys::XXX::FileDialogsystem-specific file dialog, if available for theXXXplatform. thesystemproperty knows only how to map theFileDialog,OpenDialog, andSaveDialogclasses onto the system-specific file dialog classes; the inherited classes are not affected and cannot be replaced by the system dialog.
π Methods
rereadβ re-reads the currently selected directory.
π Prima::Dialog::OpenDialog
a descendant of Prima::Dialog::FileDialog tuned for open-dialog functionality. π¦
π Prima::Dialog::SaveDialog
a descendant of Prima::Dialog::FileDialog tuned for save-dialog functionality. πΎ
π Prima::Dialog::ChDirDialog
provides standard dialog with interactive directory selection. ποΈ
π Properties
directorySTRINGβ selects the directory.showDotDirsβ selects if the directories with the first dot character are shown. Default value:0.showHelpβ create-only property. if1, the'Help'button is inserted in the dialog. Default value:0.
β AUTHOR
Dmitry Karasik, dmitry@karasik.eu.org. π
π SEE ALSO
Prima, Prima::Window, Prima::Lists, examples/drivecombo.pl, examples/launch.pl. go click around bestie πΈ
mwah π this page is from perl v5.42.0, dated 2024-08-20, and the manual name is Prima::...leDialog(3). bye bestie, slay your file dialogs π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms