File: Dialog.schelp

package info (click to toggle)
supercollider 1%3A3.6.6~repack-2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 23,792 kB
  • ctags: 25,269
  • sloc: cpp: 177,129; lisp: 63,421; ansic: 11,297; python: 1,787; perl: 766; yacc: 311; sh: 286; lex: 181; ruby: 173; makefile: 168; xml: 13
file content (56 lines) | stat: -rw-r--r-- 1,822 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
CLASS:: Dialog
redirect:: implClass
summary:: Shows various system dialogs
categories:: GUI>Accessories

DESCRIPTION::
This class allows to show various system dialogs. link::#*openPanel:: will show a dialog for selecting a file to open, and link::#*savePanel:: will show a dialog for selecting or creating a file to save to.


CLASSMETHODS::
PRIVATE:: key

METHOD:: openPanel
	Shows a dialog for selection of an existing file (or multiple files) to open. It does not do anything with the file, instead it just passes the chosen filenames to the given result handler.

	ARGUMENT:: okFunc
		An object to be evaluated when OK is pressed. As argument, either a single filename is passed as a String, or an Array of Strings for multiple selected items is passed, depending on the strong::multipleSelection:: argument.
	ARGUMENT:: cancelFunc
		An object to be evaluated when Cancel is pressed.
	ARGUMENT:: multipleSelection
		A Boolean indicating whether multiple files can be selected.
	DISCUSSION::
	Example:
code::
(
Dialog.openPanel({ arg path;
	path.postln;
},{
	"cancelled".postln;
});
)
::

METHOD:: savePanel
	Shows a dialog for selecting or creating a file to save to. It does not do anything with the selected file, and does not create any file; instead it just passes the chosen filename to the given result handler.

	ARGUMENT:: okFunc
		An object to be evaluated when OK is pressed. The chosen filename is passed as a String as argument.
	ARGUMENT:: cancelFunc
		An object to be evaluated when Cancel is pressed.
	DISCUSSION::
	Example:
code::
(
Dialog.savePanel({ arg path;
	path.postln;
},{
	"cancelled".postln;
});
)
::

METHOD:: getPaths
	note::Deprecated. Use link::#*openPanel:: instead. ::

	Implements the same functionality as *openPanel, only the last argument is named differently and defaults to true.