Name |
selectOutput()选择输出 |
||||
Examples |
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()); } } |
||||
Description |
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 threading works. 打开一个特定于平台的文件选择器对话框, 以选取要输出的文件。进行选择后, 选定的文件将被传递到 “回调” 函数。如果对话框关闭或取消, 将向该函数发送 null, 以便程序不等待其他输入。由于线程的工作方式, 回调是必需的。 |
||||
Syntax |
selectOutput(prompt, callback) selectOutput(prompt, callback, file) selectOutput(prompt, callback, file, callbackObject) selectOutput(prompt, callbackMethod, file, callbackObject, parent) selectOutput(prompt, callbackMethod, file, callbackObject, parent, sketch) |
||||
Parameters |
|
||||
Returns |
void |
- 本文固定链接: http://iprocessing.cn/2017/08/02/selectoutput选择输出/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表