Handbook
Glossary
save-panel ( path -- path/f )
Cocoa bridge
ยป
Cocoa file dialogs
Prev:
<NSSavePanel> ( -- panel )
Vocabulary
cocoa
.
dialogs
Inputs
path
a pathname string
Outputs
path/f
a pathname string or
f
Word description
Displays a file save panel, and outputs the selected path, or
f
if the user cancelled the operation.
Definition
USING:
alien.c-types
cocoa.messages
cocoa.runtime
core-foundation.strings
kernel
;
IN:
cocoa.dialogs
:
save-panel
( path -- path/f )
[
<NSSavePanel>
dup
]
dip
split-path
{
long
{
id
SEL
id
id
}
}
"runModalForDirectory:file:"
send
NSOKButton
=
[
{
id
{
id
SEL
}
}
"filename"
send
CF>string
]
[
drop
f
]
if
;