class Iup::FileDialog
A predefined modal dialog for selecting files or a directory.
Example
The following opens a “save file” dialog, filtered on Ruby files.
filedlg = Iup::FileDialog.new do |d| d.dialogtype = 'save' d.title = 'File Save' d.filter = '*.rb' d.filterinfo = 'Ruby Files' end filedlg.popup(300, 300)
Note that popup must be used to show the dialog.
Also see: Iup.get_file
Attributes
If set, indicates if non-existent filenames are accepted. Values as ‘yes’ / ‘no’ - defaults to ‘no’.
‘open’ / ‘save’ / ‘dir’
Initial directory
Defines filters, e.g. “Text files|*.txt;*.doc|Image files|*.gif;*.jpg;*.bmp|”, has priority over filterinfo and filter.
Name of file. Will be used instead of dictionary if it contains a complete path.
Filter to use, e.g. “*.C;*.LED;test.*”.
Information about the filter, e.g. “C files”.
n, index of filter from extfilter that was used. Index counts from 1.
‘no’ / ‘yes’, set to allow selection of multiple files.
‘yes’ / ‘no’, if set, restores current directory after dialog is closed.
‘no’ / ‘yes’, if set, prompts before overwriting existing files.
‘no’ / ‘yes’, if set, shows a preview area for file.
Returns an integer: 1 for new file, 0 for existing file/directory, or -1 for cancelled.
Name of file(s) selected.
Public Class Methods
Source
# File lib/wrapped/filedialog.rb, line 51 def initialize @handle = IupLib.IupFileDlg # run any provided block on instance, to set up further attributes yield self if block_given? end
Creates a new dialog. If a block is given, the new instance is yielded to it.
Callbacks
Attributes
Sets callback for when a file is selected. callback must respond to call and take two arguments: (filename, status)
-
filename- filename of selected file -
status-