Class globals gui FileSelector
FileSelector class (derived from Dialog class). SYNOPSIS: FileSelector.new(<callback>, <title>, <button> [, <pattern> [, <dir> [, <file> [, <dotfiles>]]]]) callback ... callback function that gets return value as first argument title ... dialog title button ... button text (should say "Save", "Load", etc. and not just "OK") pattern ... array with shell pattern or nil (which is equivalent to "*") dir ... starting dir ($FG_ROOT if unset) file ... pre-selected default file name dotfiles ... flag that decides whether UNIX dotfiles should be shown (1) or not (0) EXAMPLE: var report = func(n) { print("file ", n.getValue(), " selected") } var selector = gui.FileSelector.new( report, # callback function "Save Flight", # dialog title "Save", # button text ["*.sav", "*.xml"], # pattern for displayed files "/tmp", # start dir "flight.sav"); # default file name selector.open(); selector.close(); selector.set_title("Save Another Flight"); selector.open();
Functions
set_title
setters only take effect after the next call to open()