8772
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
8771
|
3 |
"{ Package: 'stx:libview' }"
|
|
4 |
|
|
5 |
"{ NameSpace: Smalltalk }"
|
|
6 |
|
|
7 |
DeviceWorkstation subclass:#ElectronWorkstation
|
|
8 |
instanceVariableNames:'bridge'
|
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
|
11 |
category:'Interface-Graphics'
|
|
12 |
!
|
|
13 |
|
|
14 |
!ElectronWorkstation class methodsFor:'documentation'!
|
|
15 |
|
|
16 |
documentation
|
|
17 |
"
|
8772
|
18 |
Smalltalk at:#Display2 put:(ElectronWorkstation newFor:nil).
|
|
19 |
(TopView onDevice:Display2)
|
|
20 |
label:'Hello';
|
|
21 |
open
|
8771
|
22 |
"
|
|
23 |
! !
|
|
24 |
|
|
25 |
!ElectronWorkstation methodsFor:'accessing & queries'!
|
|
26 |
|
|
27 |
isOpen
|
|
28 |
"return true, if there is a valid connection to the display"
|
|
29 |
|
|
30 |
^ bridge notNil
|
|
31 |
! !
|
|
32 |
|
|
33 |
!ElectronWorkstation methodsFor:'initialization & release'!
|
|
34 |
|
|
35 |
closeConnection
|
|
36 |
"close down connection to Display - usually never done"
|
|
37 |
|
|
38 |
|b|
|
|
39 |
|
|
40 |
(b := bridge) notNil ifTrue:[
|
|
41 |
bridge := nil.
|
|
42 |
b close
|
|
43 |
].
|
|
44 |
|
|
45 |
"Created: 13.1.1997 / 22:10:07 / cg"
|
|
46 |
!
|
|
47 |
|
|
48 |
initializeFor:aHostAndPortStringOrNil
|
|
49 |
bridge := NodeJSBridge newBridgeForHostAndPort:aHostAndPortStringOrNil.
|
|
50 |
bridge
|
|
51 |
startBridgeIn:'.'
|
|
52 |
command:'node'
|
|
53 |
environment:nil
|
|
54 |
debug:false.
|
|
55 |
bridge connect.
|
|
56 |
|
|
57 |
"
|
|
58 |
ElectronWorkstation newFor:'localhost:8098'
|
|
59 |
"
|
|
60 |
! !
|
|
61 |
|
|
62 |
!ElectronWorkstation class methodsFor:'documentation'!
|
|
63 |
|
|
64 |
version_CVS
|
|
65 |
^ '$Header$'
|
|
66 |
! !
|
|
67 |
|