took over reparenting method from demo.
authorClaus Gittinger <cg@exept.de>
Wed, 17 Feb 1999 01:06:20 +0100
changeset 1102 1ee9a1bc9241
parent 1101 712810d0e8a9
child 1103 b98a73cd2ed1
took over reparenting method from demo.
ExternalTopView.st
--- a/ExternalTopView.st	Wed Feb 17 00:25:00 1999 +0100
+++ b/ExternalTopView.st	Wed Feb 17 01:06:20 1999 +0100
@@ -128,8 +128,54 @@
 
 ! !
 
+!ExternalTopView methodsFor:'special'!
+
+becomeParentOf:anSTXWindow
+    "add myself to the windowGroup of anSTXWindow ...
+     and reparent anSTXWindow to be the (only) child of myself"
+
+    |wg oldTopView|
+
+    anSTXWindow createWithAllSubViews.
+
+    oldTopView := anSTXWindow topView.
+
+    wg := anSTXWindow windowGroup.
+    wg notNil ifTrue:[
+        wg addTopView:self.
+    ].
+
+    oldTopView == anSTXWindow ifTrue:[
+        oldTopView container:self.
+    ].
+
+    self open. "/ not really an open; however it starts its event handler
+
+    wg isNil ifTrue:[
+        oldTopView windowGroup:self windowGroup.
+    ].
+
+    anSTXWindow device 
+        reparentWindow:anSTXWindow id
+        to:self id.
+
+    self addSubView:anSTXWindow.
+    anSTXWindow enableEvent:#structureNotify.
+
+    anSTXWindow realize.
+    anSTXWindow map.
+    wg notNil ifTrue:[
+        wg removeView:oldTopView.
+        wg addView:oldTopView.
+    ].
+
+    anSTXWindow origin:0.0 @ 0.0 corner:1.0 @ 1.0.
+
+
+! !
+
 !ExternalTopView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ExternalTopView.st,v 1.8 1999-02-16 23:25:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ExternalTopView.st,v 1.9 1999-02-17 00:06:20 cg Exp $'
 ! !