WorkspaceApplication.st
changeset 3332 91e39add4561
parent 3282 c871f7928ff2
child 3334 3c6e88d38b59
--- a/WorkspaceApplication.st	Tue Oct 23 10:54:04 2001 +0200
+++ b/WorkspaceApplication.st	Tue Oct 23 22:13:46 2001 +0200
@@ -309,6 +309,34 @@
       )
 ! !
 
+!WorkspaceApplication class methodsFor:'special startup'!
+
+openSystemWorkspace
+    |wsApp readMeWs sysWs licenceView|
+
+    wsApp := self new.
+    wsApp allButOpen.
+    wsApp window extent:500@400.
+
+    wsApp addWindow:(licenceView := HVScrollableView for:HTMLDocumentView) named:'License'.
+    licenceView homeDocument:'../../doc/online/english/LICENCE_STX.html'.
+    licenceView updateLabelFlag:false.
+
+    wsApp addWindow:(readMeWs := HVScrollableView for:Workspace) named:'README'.
+    wsApp loadFile:'../../README'.
+
+    wsApp addWindow:(sysWs := HVScrollableView for:Workspace) named:'Welcome'.
+    wsApp loadFile:'Hello.wsp'.
+
+    wsApp workspaceSelectionChanged.
+
+    wsApp openWindow
+
+    "
+     self openSystemWorkspace
+    "
+! !
+
 !WorkspaceApplication methodsFor:'accessing'!
 
 selectedWorkspace
@@ -482,23 +510,29 @@
 "/    self selectedWorkspace inspectIt
 !
 
+loadFile:aFileName 
+    |file ws lbl|
+
+    file := aFileName asFilename.
+    (ws := self selectedWorkspacesTextView) contents:file contentsOfEntireFile.
+    ws modified:false.
+
+    lbl := file withoutSuffix baseName.
+    tabList size <= 1 ifTrue:[
+        self window label:lbl.
+    ] ifFalse:[
+        tabList at:self selectedWorkspaceIndexHolder value put:lbl
+    ]
+!
+
 menuLoad
-    |file ws lbl|
+    |file|
 
     (self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self].
 
     file := Dialog requestFileName:'Load file:' default:'file.wsp'.
     file size > 0 ifTrue:[
-        file := file asFilename.
-        (ws := self selectedWorkspacesTextView) contents:file contentsOfEntireFile.
-        ws modified:false.
-
-        lbl := file withoutSuffix baseName.
-        tabList size <= 1 ifTrue:[
-            self window label:lbl.
-        ] ifFalse:[
-            tabList at:self selectedWorkspaceIndexHolder value put:lbl
-        ]
+        self loadFile:file
     ]
 !
 
@@ -647,5 +681,5 @@
 !WorkspaceApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.13 2001-10-10 09:44:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.14 2001-10-23 20:13:46 cg Exp $'
 ! !