Waiting for deferred UI messages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Waiting for deferred UI messages

Sean P. DeNigris
Administrator
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
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Waiting for deferred UI messages

Gary Chambers-4
This will get stuck if running in the UI process itself...

Regards, Gary

----- Original Message -----
From: "Sean P. DeNigris" <[hidden email]>
To: <[hidden email]>
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.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Waiting for deferred UI messages

Sean P. DeNigris
Administrator
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.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Waiting for deferred UI messages

Stéphane Ducasse
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.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>