[Pharo-project] Waiting for deferred UI messages
testSimulateRightClick | workspace menu sem | workspace := Workspace open. [ morph := World submorphThat: [ :m | m model == workspace ] ifNone: [ nil ]. (Delay forMilliseconds: 100) wait. morph isNil ] whileTrue. WorldState addDeferredUIMessage: [ morph simulateRightClick ]. [ "execution gets stuck in this loop" menu := World submorphThat: [:m | m isKindOf: MenuMorph ] ifNone: [ nil ]. (Delay forMilliseconds: 100) wait. menu isNil ] whileTrue. self assert: menu isNil not. menu delete. When running from OB, the above deferred message block never gets evaluated. Execution loops forever in the last block. I thought that the delay would give the UI an opportunity to process it. How do I modify this to work? Thanks. Sean -- View this message in context: http://forum.world.st/Waiting-for-deferred-UI-messages-tp4179541p4179541.htm... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
This will get stuck if running in the UI process itself... Regards, Gary ----- Original Message ----- From: "Sean P. DeNigris" <sean@clipperadams.com> To: <pharo-project@lists.gforge.inria.fr> Sent: Saturday, December 10, 2011 7:38 AM Subject: [Pharo-project] Waiting for deferred UI messages
testSimulateRightClick
| workspace menu sem | workspace := Workspace open. [ morph := World submorphThat: [ :m | m model == workspace ] ifNone: [ nil ]. (Delay forMilliseconds: 100) wait. morph isNil ] whileTrue.
WorldState addDeferredUIMessage: [ morph simulateRightClick ].
[ "execution gets stuck in this loop" menu := World submorphThat: [:m | m isKindOf: MenuMorph ] ifNone: [ nil ]. (Delay forMilliseconds: 100) wait. menu isNil ] whileTrue. self assert: menu isNil not. menu delete.
When running from OB, the above deferred message block never gets evaluated. Execution loops forever in the last block. I thought that the delay would give the UI an opportunity to process it. How do I modify this to work?
Thanks. Sean
-- View this message in context: http://forum.world.st/Waiting-for-deferred-UI-messages-tp4179541p4179541.htm... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
Gary Chambers-4 wrote
This will get stuck if running in the UI process itself...
Thanks Gary! I actually had a dream about this last night (I obviously need a vacation or another hobby). I visualized myself flying through the path of execution and realized exactly that. -- View this message in context: http://forum.world.st/Waiting-for-deferred-UI-messages-tp4179541p4186571.htm... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
if the symptoms continue you should stop :) I knew pharo was a strong drug but not at this level :) Stef
Thanks Gary! I actually had a dream about this last night (I obviously need a vacation or another hobby). I visualized myself flying through the path of execution and realized exactly that.
-- View this message in context: http://forum.world.st/Waiting-for-deferred-UI-messages-tp4179541p4186571.htm... Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
participants (3)
-
Gary Chambers -
Sean P. DeNigris -
Stéphane Ducasse