ElectronWorkstation.st
changeset 8834 d6c5483bf5c0
parent 8833 5044eaa4cce2
child 8835 1c6fe641f815
--- a/ElectronWorkstation.st	Tue Oct 15 11:10:05 2019 +0200
+++ b/ElectronWorkstation.st	Tue Oct 15 12:38:01 2019 +0200
@@ -68,15 +68,24 @@
 !
 
 example3
-    |v dpy|
+    |v1 v2 dpy|
 
     Smalltalk at:#Display2 put:(dpy := ElectronWorkstation newFor:'localhost:8888').
 
-    v := (TopView onDevice:dpy) 
-            label:'Hello';
+    v1 := (TopView onDevice:dpy)
+            extent:(200 @ 150);
+            label:'Hello1';
             open.
-    v waitUntilVisible.
-    v close.
+    v2 := (TopView onDevice:dpy)
+            extent:(200 @ 150);
+            label:'Hello2';
+            open.
+
+    Delay waitForSeconds:1.
+    v1 close.
+    Delay waitForSeconds:1.
+    v2 close.
+    Delay waitForSeconds:1.
     dpy close.
 
     "
@@ -286,15 +295,30 @@
         label:label owner:owner
         icon:icn iconMask:icnM iconView:icnV
 
+    "returns a remote window handler"
+
     |result|
 
-    result := bridge callFunction:'createWindow' withArguments:#().
+    "/ does not work - BrowserWindow is invisible 
+"/    result := bridge 
+"/                eval:'var win = new BrowserWindow(
+"/                                    {
+"/                                     width: arguments[0], 
+"/                                     height: arguments[1]
+"/                                    });
+"/                      return makeRef(win, "electronWindow");'
+"/                withArguments:{ ext x . ext y }.
+    result := bridge 
+                callFunction:'createWindow' 
+                withArguments:{ ext x . ext y }.
     ^ result
 !
 
-destroyView:aView withId:aWindowId
-
-    Logger info:'unimplemented: destroyView:'.
+destroyView:aView withId:aWindowHandle
+    bridge 
+        invokeMethod:'close' 
+        object:aWindowHandle 
+        arguments:#()
 !
 
 mapWindow:aWindowId