type: ONEOF open, save, openFolder, createFolder (default: open)
Action to perform.
type: string (default: "")
Current name in the file selector, as if entered by the user. This should be used for example in a "Save as" dialog to suggest a name.
type: string (default: "")
Current folder.
type: string (default: "")
ID of a Gnocl widget, for extra options.
type: string (default: "")
Current filename.
type: boolean (default: 0)
Whether to return URIs instead of file names. (This is not yet tested.)
type: boolean
Whether only local files can be chosen.
type: string
Name of the widget, can be used to set options in an rc file.
type: string (default: "")
Tcl command which is executed if the widget is destroyed. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name. TABLE
type: string (default: "")
Tcl command to be executed, if the preview widget has to be updated. Before evaluation the following percent strings are substituted: TABLE %% | % %w | widget name /TABLE
type: string (default: "")
ID of a Gnocl widget to display a custom preview of the currently selected file.
type: bool (default: 1)
Whether the preview widget is active.
type: bool (default: 0)
Whether multiple files may be selected.
type: bool (default: 0)
Whether hidden files are shown.
type: string (default: "")
Title of the dialog. -visible; boolean; 1 Whether or not the item is visible.
This command is available since GTK+ 2.4. A fileChooser is used to let the user choose a directory or one or more files in a standardized way. The commands returns a list of files if multiple files can be chosen. Otherwise it returns directly the directory of file chosen.
id delete
Deletes the widget and the associated tcl command.
id configure [-option value...]
Configures the widget. Option may have any of the values accepted on creation of the widget.
id cget option
Returns the value for one option. The option may have any of the values accepted by configure.
proc doPreview { widget file } { set preview [$widget cget -previewWidget] if { [catch {$preview configure -visible 1 -image %/$file} erg] } { $preview configure -visible 0 } $widget configure -previewWidgetActive 1 } set file [gnocl::fileChooser -title "Please choose a picture file" -previewWidget [gnocl::image] -onUpdatePreview "doPreview %w %f"]
results in