In a Mathematica notebook, I execute the following lines,
Needs["GUIKit`"];
GUIRun[Widget["FileDialog"]];
What looks like a standard File Dialog window appears. Using the dialog, I select a file and then click the “Open” button and nothing happens. The dialog remains on the screen and there is no indication of any activity on the notebook. Normally when I use a file dialog in Java or a dot net language the dialog disappears when I click the open button and the file path/name string are placed in a variable and I use that string to open the file.
I looked at the documentation on FileDialog and it is anything but clear which doesn’t surprise me too much.
So, does anyone know how to use the FileDialog in Mathemetica?
assuming that “test” is a direct subdirectory of NotebookDirectory[] and that there are 2 files bertGraph*.jpep and morleyS18*.jpeg in subdirectory test. If you run the following cell and click in the appearing window
One cannot state that it is not working, because there is an example in the Help GUIKit/tutorial/TextImportWizard if you call it it opens a file dialog
and in the Code section above in the manual you see where the code comes from: it is in directory (drive letter depends on local installation)
S:\Program Files\Wolfram Research\Mathematica\9.0.1\AddOns\Packages\GUIKit\GUI\Wolfram\Example
and there are files TextImportWizard.m and TextImportWizardScriptCode.m and in the latter one there is BrowseFilename[] which works and uses a Widget[“FileDialog”, …] and can serve as a starting point.