DeviceWorkstation.st
changeset 3513 64ae1498b94c
parent 3478 b9d198097d10
child 3517 f0e11daf1d3a
equal deleted inserted replaced
3512:e7da73a7e77b 3513:64ae1498b94c
  1389 viewIdFromPoint:aPoint
  1389 viewIdFromPoint:aPoint
  1390     "given a point on the screen, return the id of the ST/X view in which that
  1390     "given a point on the screen, return the id of the ST/X view in which that
  1391      point is (this may be a subview). Return nil, if its not an ST/X view
  1391      point is (this may be a subview). Return nil, if its not an ST/X view
  1392      or if the point is on the background"
  1392      or if the point is on the background"
  1393 
  1393 
  1394     |searchId foundId|
  1394     |searchId foundId n|
  1395 
  1395 
  1396     searchId := self realRootWindowId.
  1396     searchId := self realRootWindowId.
  1397 
  1397 
  1398     "/ this is required, since X raises a bad error, when we come
  1398     "/ this is required, since X raises a bad error, when we come
  1399     "/ along with an illegal id (which happens, if a view from another
  1399     "/ along with an illegal id (which happens, if a view from another
  1400     "/ screen-device is picked ...)
  1400     "/ screen-device is picked ...)
  1401     self class deviceErrorSignal handle:[:ex |
  1401     self class deviceErrorSignal handle:[:ex |
  1402 	^ nil
  1402         ^ nil
  1403     ] do:[
  1403     ] do:[
  1404 	[searchId notNil] whileTrue:[
  1404         n := 0.
  1405 	    foundId := searchId.
  1405         [searchId notNil] whileTrue:[
  1406 	    searchId := self viewIdFromPoint:aPoint in:searchId.
  1406             n := n + 1.
  1407 	]
  1407             n > 1000 ifTrue:[
       
  1408                 self halt:'oops - endless view hierarchy'.
       
  1409                 ^ nil
       
  1410             ].
       
  1411             foundId := searchId.
       
  1412             searchId := self viewIdFromPoint:aPoint in:searchId.
       
  1413         ]
  1408     ].
  1414     ].
  1409     ^ foundId
  1415     ^ foundId
  1410 !
  1416 !
  1411 
  1417 
  1412 viewIdFromPoint:aPoint in:windowId
  1418 viewIdFromPoint:aPoint in:windowId
  7334 ! !
  7340 ! !
  7335 
  7341 
  7336 !DeviceWorkstation class methodsFor:'documentation'!
  7342 !DeviceWorkstation class methodsFor:'documentation'!
  7337 
  7343 
  7338 version
  7344 version
  7339     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.401 2001-09-05 17:27:05 cg Exp $'
  7345     ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.402 2001-09-28 07:08:25 cg Exp $'
  7340 ! !
  7346 ! !
  7341 DeviceWorkstation initialize!
  7347 DeviceWorkstation initialize!