FileDialogNSSavePanel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FileDialogNSSavePanel

Maarten Mostert-2
Hi,

I am in 7.9.1

If I specify #mustBeNew upon saving a new file using SaveFileDialog (which in turn calls FileDialogNSSavePanel) it will use its open method.

If I then cancel upon the selection definitelyExists dialog the selection is set to nil. <<selection := nil>>
the  <<selectedStrings := Array with: selection asString.>> below then fails.

Regards,

@+Maarten,



open
"Open the dialog and answer true if a selection was made, false if the dialog was cancelled.
Set the instance variable #selectedStrings accordingly."

| selection |
selection := self openDialogIfCancel: [^self cancel].

(fileCondition == #old and: [selection definitelyExists not]) ifTrue: 
[(Dialog confirm: (self fileDoesNotExistMessage: selection))
ifFalse: [^self open]].
(fileCondition == #mustBeNew and: [selection definitelyExists]) ifTrue: 
[(Dialog confirm: (self fileAlreadyExistsMessage: selection))
ifTrue: [^self open]
ifFalse: [selection := nil]].

selectedStrings := Array with: selection asString.
SaveFileDialog lastDirectory: selection directory.
^true

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc