| [ Web Proxy ] |
| Viewing: https://processing.org/reference/selectOutput_.html | [Back] [Original] |
Opens a platform-specific file chooser dialog to select a file for output. After the selection is made, the selected File will be passed to the 'callback' function. If the dialog is closed or canceled, null will be sent to the function, so that the program is not waiting for additional input. The callback is necessary because of how threadingworks.
void setup() {
selectOutput("Select a file to write to:", "fileSelected");
}
void fileSelected(File selection) {
if (selection == null) {
println("Window was closed or the user hit cancel.");
} else {
println("User selected " + selection.getAbsolutePath());
}
}
selectOutput(prompt, callback)selectOutput(prompt, callback, file)selectOutput(prompt, callback, file, callbackObject)prompt(String)message to theusercallback(String)name of the method to be called when the selection ismadevoid
[Creative Commons License]This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
| Web Proxy Viewer | New URL | Original Page |