--- a/TextView.st Wed Oct 13 02:01:27 1993 +0100
+++ b/TextView.st Wed Oct 13 02:04:14 1993 +0100
@@ -30,7 +30,7 @@
COPYRIGHT (c) 1989-93 by Claus Gittinger
All Rights Reserved
-%W% %E%
+$Header: /cvs/stx/stx/libwidg/TextView.st,v 1.2 1993-10-13 01:03:50 claus Exp $
written jun-89 by claus
autoscroll added spring 92 by claus
@@ -111,7 +111,7 @@
top := textView topView.
aFileName notNil ifTrue:[
top label:(OperatingSystem baseNameOf:aFileName).
- textView fromFile:aFileName
+ textView contents:(aFileName asFilename readStream contents)
].
top realize.
@@ -125,8 +125,6 @@
initialize
super initialize.
- resources := ResourcePack fromFile:'TextViews.rs'.
- resources addDependent:self.
contentsWasSaved := false
!
@@ -207,7 +205,6 @@
lineNumberBox destroy.
lineNumberBox := nil
].
- resources removeDependent:self.
super destroy
! !
@@ -355,10 +352,13 @@
saveAs:fileName
"save contents into a file named fileName"
- |aStream|
+ |aStream msg|
aStream := FileStream newFileNamed:fileName.
- aStream notNil ifTrue:[
+ aStream isNil ifTrue:[
+ msg := resources string:'cannot write file %1 !!' with:fileName.
+ self warn:(msg , '\\(' , OperatingSystem lastErrorString , ')' ) withCRs
+ ] ifFalse:[
self fileOutContentsOn:aStream.
aStream close.
contentsWasSaved := true
@@ -371,9 +371,9 @@
fileBox isNil ifTrue:[
fileBox := FileSelectionBox
- title:'save contents in:'
- okText:'save'
- abortText:'cancel'
+ title:(resources string:'save contents in:')
+ okText:(resources string:'save')
+ abortText:(resources string:'cancel')
action:[:fileName | self saveAs:fileName]
].
directoryForFileDialog notNil ifTrue:[
@@ -416,9 +416,9 @@
lineNumberBox isNil ifTrue:[
lineNumberBox :=
EnterBox
- title:(resources at:'line number:')
- okText:(resources at:'goto')
- abortText:(resources at:'cancel')
+ title:(resources string:'line number:')
+ okText:(resources string:'goto')
+ abortText:(resources string:'cancel')
action:[:l | self gotoLine:(Number readFromString:l)]
].
lineNumberBox showAtPointer