PopUpView.st
changeset 141 caf4432fae8f
parent 135 cf8e46015072
child 144 cf645a1ebbb3
--- a/PopUpView.st	Tue May 09 02:23:52 1995 +0200
+++ b/PopUpView.st	Wed May 10 04:26:41 1995 +0200
@@ -22,7 +22,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
 
-$Header: /cvs/stx/stx/libview/PopUpView.st,v 1.11 1995-05-03 00:25:03 claus Exp $
+$Header: /cvs/stx/stx/libview/PopUpView.st,v 1.12 1995-05-10 02:25:39 claus Exp $
 '!
 
 !PopUpView class methodsFor:'documentation'!
@@ -43,7 +43,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview/PopUpView.st,v 1.11 1995-05-03 00:25:03 claus Exp $
+$Header: /cvs/stx/stx/libview/PopUpView.st,v 1.12 1995-05-10 02:25:39 claus Exp $
 "
 !
 
@@ -83,7 +83,8 @@
 
 initialize
     super initialize.
-    haveControl := false
+    haveControl := false.
+    type := #popup 
 !
 
 initStyle
@@ -217,11 +218,20 @@
 !PopUpView methodsFor:'realize / unrealize'!
 
 mapped
-    "wait till visible for grabbing"
+    "wait till visible for grabbing. If the grab fails,
+     try again and unrealize myself if that fails too."
 
     super mapped.
     haveControl ifTrue:[
-	device grabPointerInView:self.
+	(device grabPointerInView:self) ifFalse:[
+	    "wait a little bit and try again"
+	    (Delay forSeconds:0.1) wait.
+	    (device grabPointerInView:self) ifFalse:[
+		"give up"
+		'could not grab pointer' errorPrintNL.
+		self unrealize
+	    ]
+	]
     ]
 !