--- a/PopUpView.st Fri Oct 31 09:56:25 2003 +0100
+++ b/PopUpView.st Tue Nov 11 15:31:05 2003 +0100
@@ -398,6 +398,8 @@
"grab the pointer here, when visible (but not control is already lost).
If the grab fails, try again and unmap myself if that fails too."
+ |count grabbed|
+
mapTime := Time millisecondClockValue.
super mapped.
@@ -407,10 +409,13 @@
and:[realized
and:[self grabWhenMapped]]]) ifTrue:[
(self grabPointer) ifFalse:[
- "wait a little bit and try again"
-"/ 'grab pointer failed' errorPrintNL.
- Delay waitForSeconds:0.1.
- (self grabPointer) ifFalse:[
+ count := 0.
+ [
+ "wait a little bit and try again"
+ Delay waitForSeconds:0.1.
+ count := count + 1.
+ ] doUntil:[ (grabbed := self grabPointer) or:[count > 4]].
+ grabbed ifFalse:[
"give up"
'PopUpView [warning]: could not grab pointer' errorPrintCR.
self unmap
@@ -453,5 +458,5 @@
!PopUpView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/PopUpView.st,v 1.53 2003-05-07 15:18:44 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/PopUpView.st,v 1.54 2003-11-11 14:31:05 cg Exp $'
! !