checkin from browser
authorca
Sat, 20 Jun 1998 10:29:02 +0200
changeset 972 b7c2386d8c60
parent 971 c000e2691543
child 973 9114f57c9977
checkin from browser
TerminalView.st
--- a/TerminalView.st	Fri Jun 19 01:05:34 1998 +0200
+++ b/TerminalView.st	Sat Jun 20 10:29:02 1998 +0200
@@ -26,18 +26,7 @@
 "
 ! !
 
-!TerminalView class methodsFor:'queries'!
-
-isVisualStartable
-    "returns whether this application class can be started via #open"
-
-    self == TerminalView ifTrue:[^ false].
-    ^ true
-
-    "Created: / 10.6.1998 / 15:48:43 / cg"
-! !
-
-!TerminalView class methodsFor:'testing'!
+!TerminalView class methodsFor:'opening'!
 
 open
     self openShell
@@ -51,6 +40,9 @@
 !
 
 openDummy
+    "for testing purposes only - opens a dummy tty-view, which simply
+     echoes whatever is typed in"
+
     |in vt52|
 
     vt52 := self new.
@@ -66,7 +58,34 @@
     "
 !
 
+openOnInput:inStream  output:outStream
+    "open a terminalView on the given streams (which are typically some
+     kind of socket). Keys pressed are sent to inStream, text appearing
+     from outStream are displayed in the terminal view.
+     This can be used to implement things like rlogin
+     or telnet views (if connected to a modem, a call-unix can also be
+     implemented this way)."
+
+    |in top scr vt52|
+
+    top := StandardSystemView new.
+    scr := ScrollableView for:self in:top.
+    scr origin:0.0@0.0 corner:1.0@1.0.
+    vt52 := scr scrolledView.
+
+    vt52 inStream:inStream.
+    vt52 outStream:outStream.
+
+    top extent:(scr preferredExtent).
+    top label:'shell'.
+    top open.
+    ^ top
+!
+
 openShell
+    "start a shell on a pseudo-TTY, open a terminalView on it
+     (i.e. this is kind of an xterm)"
+
     |in top scr vt52|
 
     top := StandardSystemView new.
@@ -88,6 +107,17 @@
     "Modified: / 12.6.1998 / 21:43:41 / cg"
 ! !
 
+!TerminalView class methodsFor:'queries'!
+
+isVisualStartable
+    "returns whether this application class can be started via #open"
+
+    self == TerminalView ifTrue:[^ false].
+    ^ true
+
+    "Created: / 10.6.1998 / 15:48:43 / cg"
+! !
+
 !TerminalView methodsFor:'accessing'!
 
 inStream
@@ -815,5 +845,5 @@
 !TerminalView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.37 1998-06-18 12:30:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/TerminalView.st,v 1.38 1998-06-20 08:29:02 ca Exp $'
 ! !