216 ! |
214 ! |
217 |
215 |
218 waitForExposeFor:aView |
216 waitForExposeFor:aView |
219 "wait until a graphicsExpose or a noExpose arrives (after a bitblt)." |
217 "wait until a graphicsExpose or a noExpose arrives (after a bitblt)." |
220 |
218 |
221 |device windowId stopPoll endPollTime| |
219 |viewsDevice windowId stopPoll endPollTime| |
222 |
220 |
223 device := aView graphicsDevice. |
221 viewsDevice := aView graphicsDevice. |
224 |
222 |
225 "/ this is only needed for X ... |
223 "/ this is only needed for X ... |
226 device scrollsAsynchronous ifTrue:[ |
224 viewsDevice scrollsAsynchronous ifTrue:[ |
227 windowId := aView id. |
225 windowId := aView id. |
228 |
226 |
229 "/ |
227 "/ |
230 "/ cannot suspend, I am a synchronous-modal sensor |
228 "/ cannot suspend, I am a synchronous-modal sensor |
231 "/ must poll for the event |
229 "/ must poll for the event |
232 "/ |
230 "/ |
233 endPollTime := Timestamp now addSeconds:2. |
231 endPollTime := Timestamp now addSeconds:2. |
234 stopPoll := false. |
232 stopPoll := false. |
235 |
233 |
236 [(gotExpose includes:aView) or:[stopPoll]] whileFalse:[ |
234 [(gotExpose includes:aView) or:[stopPoll]] whileFalse:[ |
237 (device exposeEventPendingFor:windowId withSync:true) ifTrue:[ |
235 (viewsDevice exposeEventPendingFor:windowId withSync:true) ifTrue:[ |
238 device dispatchExposeEventFor:windowId. |
236 viewsDevice dispatchExposeEventFor:windowId. |
239 ]. |
237 ]. |
240 stopPoll := Timestamp now > endPollTime. |
238 stopPoll := Timestamp now > endPollTime. |
241 Processor yield. |
239 Processor yield. |
242 ]. |
240 ]. |
243 |
241 |