PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

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

PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
Hello

I start a separate thread for the  issue brought up in the tread

    MorphicProject subclass: #EtoysProject


To see it in action make sure

     EToys-hjh.308.mcz

is loaded. It contains a fix for the menuTitleBorderColor which makes
the following Etoys project load smoothly.

Then drop the Etoys project file

    http://squeakland.org/content/articles/attach/FollowRoad.012.pr

onto the desktop.



When I choose 'World menu' -> 'Previous project', the following happens




----------------------------------
Project class
----------------------------------

returnToPreviousProject
        "Return to the project from which this project was entered. Do
nothing if the current project has no link to its previous project."

        | prevProj |
        prevProj := CurrentProject previousProject.
        prevProj ifNotNil: [prevProj enter: true revert: false
saveForRevert: false].



---------------------
MorphicProject(Project)

enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
        "Install my ChangeSet, Transcript, and scheduled views as current
globals. If returningFlag is true, we will return to the project from
whence the current project was entered; don't change its
previousProject link in this case.
        If saveForRevert is true, save the ImageSegment of the project
being left.
        If revertFlag is true, make stubs for the world of the project
being left.
        If revertWithoutAsking is true in the project being left, then
always revert."

......
CurrentProject world triggerEvent: #aboutToLeaveWorld.
.....


----------------

PasteUpMorph
--------------------

triggerEvent: anEventSelector
        "Evaluate all actions registered for <anEventSelector>. Return the
value of the last registered action."

    ^(self actionForEvent: anEventSelector) value


------------------------
PasteUpMorph
------------------------


removeModalWindow
        self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'.
        "self modalWindow: nil"



As mentioned in the thread
    MorphicProject subclass: #EtoysProject
the issue may be "resolved" by just commenting out the deprecation message.



removeModalWindow

       "self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'. "

        self flag: #fixMe.

        "self modalWindow: nil"



Should we do this for the moment until is is more clear how the
navigation mechanism in Etoys works?

Other suggestions?


Kind regards

Hannes Hirzel

Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

marcel.taeumel
Hi Hannes,

if you can manage to set-up the modal child (window), that removal should happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph >> #openModal:. For "control-flow-modality", instead, you should use a DialogWindow. See DialogWindow >> #getUserResponse.

Best,
Marcel

Am 09.10.2017 11:53:04 schrieb H. Hirzel <[hidden email]>:

Hello

I start a separate thread for the issue brought up in the tread

MorphicProject subclass: #EtoysProject


To see it in action make sure

EToys-hjh.308.mcz

is loaded. It contains a fix for the menuTitleBorderColor which makes
the following Etoys project load smoothly.

Then drop the Etoys project file

http://squeakland.org/content/articles/attach/FollowRoad.012.pr

onto the desktop.



When I choose 'World menu' -> 'Previous project', the following happens




----------------------------------
Project class
----------------------------------

returnToPreviousProject
"Return to the project from which this project was entered. Do
nothing if the current project has no link to its previous project."

| prevProj |
prevProj := CurrentProject previousProject.
prevProj ifNotNil: [prevProj enter: true revert: false
saveForRevert: false].



---------------------
MorphicProject(Project)

enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
"Install my ChangeSet, Transcript, and scheduled views as current
globals. If returningFlag is true, we will return to the project from
whence the current project was entered; don't change its
previousProject link in this case.
If saveForRevert is true, save the ImageSegment of the project
being left.
If revertFlag is true, make stubs for the world of the project
being left.
If revertWithoutAsking is true in the project being left, then
always revert."

......
CurrentProject world triggerEvent: #aboutToLeaveWorld.
.....


----------------

PasteUpMorph
--------------------

triggerEvent: anEventSelector
"Evaluate all actions registered for . Return the
value of the last registered action."

^(self actionForEvent: anEventSelector) value


------------------------
PasteUpMorph
------------------------


removeModalWindow
self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'.
"self modalWindow: nil"



As mentioned in the thread
MorphicProject subclass: #EtoysProject
the issue may be "resolved" by just commenting out the deprecation message.



removeModalWindow

"self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'. "

self flag: #fixMe.

"self modalWindow: nil"



Should we do this for the moment until is is more clear how the
navigation mechanism in Etoys works?

Other suggestions?


Kind regards

Hannes Hirzel



Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
Looking a bit further it seems that modal window probably are not the issue here

MorphicProject(Project)
enter: returningFlag revert: revertFlag saveForRevert: saveForRevert

....
        CurrentProject world triggerEvent: #aboutToLeaveWorld.
....


PasteUpMorph
triggerEvent: anEventSelector
        "Evaluate all actions registered for <anEventSelector>. Return the
value of the last registered action."

    ^(self actionForEvent: anEventSelector) value


anEventSelector is #aboutToLeaveWorld
and this is not implemented in PasteUpMorph.

We have an empty block and that causes #removeModalWindow in a way I
do not understand yet.

But if we would have

    #aboutToLeaveWorld

Then it we probably would not have this problem.

I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
Squeak 5.0 do not have it either.

--Hannes





On 10/9/17, Marcel Taeumel <[hidden email]> wrote:

> Hi Hannes,
>
> if you can manage to set-up the modal child (window), that removal should
> happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph >>
> #openModal:. For "control-flow-modality", instead, you should use a
> DialogWindow. See DialogWindow >> #getUserResponse.
>
> Best,
> Marcel
> Am 09.10.2017 11:53:04 schrieb H. Hirzel <[hidden email]>:
> Hello
>
> I start a separate thread for the issue brought up in the tread
>
> MorphicProject subclass: #EtoysProject
>
>
> To see it in action make sure
>
> EToys-hjh.308.mcz
>
> is loaded. It contains a fix for the menuTitleBorderColor which makes
> the following Etoys project load smoothly.
>
> Then drop the Etoys project file
>
> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>
> onto the desktop.
>
>
>
> When I choose 'World menu' -> 'Previous project', the following happens
>
>
>
>
> ----------------------------------
> Project class
> ----------------------------------
>
> returnToPreviousProject
> "Return to the project from which this project was entered. Do
> nothing if the current project has no link to its previous project."
>
> | prevProj |
> prevProj := CurrentProject previousProject.
> prevProj ifNotNil: [prevProj enter: true revert: false
> saveForRevert: false].
>
>
>
> ---------------------
> MorphicProject(Project)
>
> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
> "Install my ChangeSet, Transcript, and scheduled views as current
> globals. If returningFlag is true, we will return to the project from
> whence the current project was entered; don't change its
> previousProject link in this case.
> If saveForRevert is true, save the ImageSegment of the project
> being left.
> If revertFlag is true, make stubs for the world of the project
> being left.
> If revertWithoutAsking is true in the project being left, then
> always revert."
>
> ......
> CurrentProject world triggerEvent: #aboutToLeaveWorld.
> .....
>
>
> ----------------
>
> PasteUpMorph
> --------------------
>
> triggerEvent: anEventSelector
> "Evaluate all actions registered for . Return the
> value of the last registered action."
>
> ^(self actionForEvent: anEventSelector) value
>
>
> ------------------------
> PasteUpMorph
> ------------------------
>
>
> removeModalWindow
> self deprecated: 'The global becomeModal is no longer supported, use
> e.g. a dialog window'.
> "self modalWindow: nil"
>
>
>
> As mentioned in the thread
> MorphicProject subclass: #EtoysProject
> the issue may be "resolved" by just commenting out the deprecation message.
>
>
>
> removeModalWindow
>
> "self deprecated: 'The global becomeModal is no longer supported, use
> e.g. a dialog window'. "
>
> self flag: #fixMe.
>
> "self modalWindow: nil"
>
>
>
> Should we do this for the moment until is is more clear how the
> navigation mechanism in Etoys works?
>
> Other suggestions?
>
>
> Kind regards
>
> Hannes Hirzel
>
>



aboutToLeaveWorld_Screenshot_2017-10-09.png (58K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Bob Arning-2


On 10/9/17 9:13 AM, H. Hirzel wrote:
Looking a bit further it seems that modal window probably are not the issue here

MorphicProject(Project)
enter: returningFlag revert: revertFlag saveForRevert: saveForRevert

....
	CurrentProject world triggerEvent: #aboutToLeaveWorld.
....


PasteUpMorph
triggerEvent: anEventSelector
	"Evaluate all actions registered for <anEventSelector>. Return the
value of the last registered action."

    ^(self actionForEvent: anEventSelector) value


anEventSelector is #aboutToLeaveWorld
and this is not implemented in PasteUpMorph.

We have an empty block and that causes #removeModalWindow in a way I
do not understand yet.

But if we would have

    #aboutToLeaveWorld

Then it we probably would not have this problem.

I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
Squeak 5.0 do not have it either.

It's not a method, it's an event selector:

    CurrentProject world triggerEvent: #aboutToLeaveWorld.

WebCamMorph>>intoWorld: aWorld


    super intoWorld: aWorld.
    camIsOn ifTrue: [self on]
                    ifFalse:[self off].
    self removeActionsForEvent: #aboutToEnterWorld.
    aWorld
        when: #aboutToLeaveWorld
        send: #outOfWorld:
        to: self
        with: aWorld.

similar stuff removed in the intervening years

B3DSceneMorph>>intoWorld: aWorld

    "The receiver is showing in the given world"
    aWorld ifNil:[^self].
    super intoWorld: aWorld.
    aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to: self.
    aWorld when: #aboutToEnterWorld send: #restoreAcceleration to: self.
    self restoreAcceleration.

also for WonderlandCameraMorph

--Hannes





On 10/9/17, Marcel Taeumel [hidden email] wrote:
Hi Hannes,

if you can manage to set-up the modal child (window), that removal should
happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph >>
#openModal:. For "control-flow-modality", instead, you should use a
DialogWindow. See DialogWindow >> #getUserResponse.

Best,
Marcel
Am 09.10.2017 11:53:04 schrieb H. Hirzel [hidden email]:
Hello

I start a separate thread for the issue brought up in the tread

MorphicProject subclass: #EtoysProject


To see it in action make sure

EToys-hjh.308.mcz

is loaded. It contains a fix for the menuTitleBorderColor which makes
the following Etoys project load smoothly.

Then drop the Etoys project file

http://squeakland.org/content/articles/attach/FollowRoad.012.pr

onto the desktop.



When I choose 'World menu' -> 'Previous project', the following happens




----------------------------------
Project class
----------------------------------

returnToPreviousProject
"Return to the project from which this project was entered. Do
nothing if the current project has no link to its previous project."

| prevProj |
prevProj := CurrentProject previousProject.
prevProj ifNotNil: [prevProj enter: true revert: false
saveForRevert: false].



---------------------
MorphicProject(Project)

enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
"Install my ChangeSet, Transcript, and scheduled views as current
globals. If returningFlag is true, we will return to the project from
whence the current project was entered; don't change its
previousProject link in this case.
If saveForRevert is true, save the ImageSegment of the project
being left.
If revertFlag is true, make stubs for the world of the project
being left.
If revertWithoutAsking is true in the project being left, then
always revert."

......
CurrentProject world triggerEvent: #aboutToLeaveWorld.
.....


----------------

PasteUpMorph
--------------------

triggerEvent: anEventSelector
"Evaluate all actions registered for . Return the
value of the last registered action."

^(self actionForEvent: anEventSelector) value


------------------------
PasteUpMorph
------------------------


removeModalWindow
self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'.
"self modalWindow: nil"



As mentioned in the thread
MorphicProject subclass: #EtoysProject
the issue may be "resolved" by just commenting out the deprecation message.



removeModalWindow

"self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'. "

self flag: #fixMe.

"self modalWindow: nil"



Should we do this for the moment until is is more clear how the
navigation mechanism in Etoys works?

Other suggestions?


Kind regards

Hannes Hirzel





      



Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
On 10/9/17, Bob Arning <[hidden email]> wrote:

>
>
> On 10/9/17 9:13 AM, H. Hirzel wrote:
>> Looking a bit further it seems that modal window probably are not the
>> issue here
>>
>> MorphicProject(Project)
>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>
>> ....
>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>> ....
>>
>>
>> PasteUpMorph
>> triggerEvent: anEventSelector
>> "Evaluate all actions registered for <anEventSelector>. Return the
>> value of the last registered action."
>>
>>      ^(self actionForEvent: anEventSelector) value
>>
>>
>> anEventSelector is #aboutToLeaveWorld
>> and this is not implemented in PasteUpMorph.
>>
>> We have an empty block and that causes #removeModalWindow in a way I
>> do not understand yet.
>>
>> But if we would have
>>
>>      #aboutToLeaveWorld
>>
>> Then it we probably would not have this problem.
>>
>> I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
>> Squeak 5.0 do not have it either.
>
> It's not a method, it's an event selector:
>
>      CurrentProject world triggerEvent: #aboutToLeaveWorld.
>
> WebCamMorph>>intoWorld: aWorld
>
>
>      super intoWorld: aWorld.
>      camIsOn ifTrue: [self on]
>                      ifFalse:[self off].
>      self removeActionsForEvent: #aboutToEnterWorld.
>      aWorld
>          when: #aboutToLeaveWorld
>          send: #outOfWorld:
>          to: self
>          with: aWorld.
>
> similar stuff removed in the intervening years
>
> B3DSceneMorph>>intoWorld: aWorld
>
>      "The receiver is showing in the given world"
>      aWorld ifNil:[^self].
>      super intoWorld: aWorld.
>      aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to: self.
>      aWorld when: #aboutToEnterWorld send: #restoreAcceleration to: self.
>      self restoreAcceleration.
>
> also for WonderlandCameraMorph
>>
>> --Hannes

Thank you for pointing this out, Bob.

In Squeak 6.0a WebCamMorph is the only morph sending

     #when:send:to:with:


And there are only a few senders of

     #triggerEvent:

(see screen shot)

So how would you, Bob,  suggest to proceed?


--Hannes



>>
>> On 10/9/17, Marcel Taeumel <[hidden email]> wrote:
>>> Hi Hannes,
>>>
>>> if you can manage to set-up the modal child (window), that removal
>>> should
>>> happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph
>>> >>
>>> #openModal:. For "control-flow-modality", instead, you should use a
>>> DialogWindow. See DialogWindow >> #getUserResponse.
>>>
>>> Best,
>>> Marcel
>>> Am 09.10.2017 11:53:04 schrieb H. Hirzel <[hidden email]>:
>>> Hello
>>>
>>> I start a separate thread for the issue brought up in the tread
>>>
>>> MorphicProject subclass: #EtoysProject
>>>
>>>
>>> To see it in action make sure
>>>
>>> EToys-hjh.308.mcz
>>>
>>> is loaded. It contains a fix for the menuTitleBorderColor which makes
>>> the following Etoys project load smoothly.
>>>
>>> Then drop the Etoys project file
>>>
>>> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>>>
>>> onto the desktop.
>>>
>>>
>>>
>>> When I choose 'World menu' -> 'Previous project', the following happens
>>>
>>>
>>>
>>>
>>> ----------------------------------
>>> Project class
>>> ----------------------------------
>>>
>>> returnToPreviousProject
>>> "Return to the project from which this project was entered. Do
>>> nothing if the current project has no link to its previous project."
>>>
>>> | prevProj |
>>> prevProj := CurrentProject previousProject.
>>> prevProj ifNotNil: [prevProj enter: true revert: false
>>> saveForRevert: false].
>>>
>>>
>>>
>>> ---------------------
>>> MorphicProject(Project)
>>>
>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>> "Install my ChangeSet, Transcript, and scheduled views as current
>>> globals. If returningFlag is true, we will return to the project from
>>> whence the current project was entered; don't change its
>>> previousProject link in this case.
>>> If saveForRevert is true, save the ImageSegment of the project
>>> being left.
>>> If revertFlag is true, make stubs for the world of the project
>>> being left.
>>> If revertWithoutAsking is true in the project being left, then
>>> always revert."
>>>
>>> ......
>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>> .....
>>>
>>>
>>> ----------------
>>>
>>> PasteUpMorph
>>> --------------------
>>>
>>> triggerEvent: anEventSelector
>>> "Evaluate all actions registered for . Return the
>>> value of the last registered action."
>>>
>>> ^(self actionForEvent: anEventSelector) value
>>>
>>>
>>> ------------------------
>>> PasteUpMorph
>>> ------------------------
>>>
>>>
>>> removeModalWindow
>>> self deprecated: 'The global becomeModal is no longer supported, use
>>> e.g. a dialog window'.
>>> "self modalWindow: nil"
>>>
>>>
>>>
>>> As mentioned in the thread
>>> MorphicProject subclass: #EtoysProject
>>> the issue may be "resolved" by just commenting out the deprecation
>>> message.
>>>
>>>
>>>
>>> removeModalWindow
>>>
>>> "self deprecated: 'The global becomeModal is no longer supported, use
>>> e.g. a dialog window'. "
>>>
>>> self flag: #fixMe.
>>>
>>> "self modalWindow: nil"
>>>
>>>
>>>
>>> Should we do this for the moment until is is more clear how the
>>> navigation mechanism in Etoys works?
>>>
>>> Other suggestions?
>>>
>>>
>>> Kind regards
>>>
>>> Hannes Hirzel
>>>
>>>
>>>
>>>
>
>



Senders_of_triggerEvent_in_Squeak6.0a_Screenshot_2017-10-09.png (75K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
I need to do investigations how the Squeak 6 based etoys 2016 image by
Tim Felgentreff does this.

http://wiki.squeak.org/squeak/6531

...

On 10/9/17, H. Hirzel <[hidden email]> wrote:

> On 10/9/17, Bob Arning <[hidden email]> wrote:
>>
>>
>> On 10/9/17 9:13 AM, H. Hirzel wrote:
>>> Looking a bit further it seems that modal window probably are not the
>>> issue here
>>>
>>> MorphicProject(Project)
>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>
>>> ....
>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>> ....
>>>
>>>
>>> PasteUpMorph
>>> triggerEvent: anEventSelector
>>> "Evaluate all actions registered for <anEventSelector>. Return the
>>> value of the last registered action."
>>>
>>>      ^(self actionForEvent: anEventSelector) value
>>>
>>>
>>> anEventSelector is #aboutToLeaveWorld
>>> and this is not implemented in PasteUpMorph.
>>>
>>> We have an empty block and that causes #removeModalWindow in a way I
>>> do not understand yet.
>>>
>>> But if we would have
>>>
>>>      #aboutToLeaveWorld
>>>
>>> Then it we probably would not have this problem.
>>>
>>> I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
>>> Squeak 5.0 do not have it either.
>>
>> It's not a method, it's an event selector:
>>
>>      CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>
>> WebCamMorph>>intoWorld: aWorld
>>
>>
>>      super intoWorld: aWorld.
>>      camIsOn ifTrue: [self on]
>>                      ifFalse:[self off].
>>      self removeActionsForEvent: #aboutToEnterWorld.
>>      aWorld
>>          when: #aboutToLeaveWorld
>>          send: #outOfWorld:
>>          to: self
>>          with: aWorld.
>>
>> similar stuff removed in the intervening years
>>
>> B3DSceneMorph>>intoWorld: aWorld
>>
>>      "The receiver is showing in the given world"
>>      aWorld ifNil:[^self].
>>      super intoWorld: aWorld.
>>      aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to: self.
>>      aWorld when: #aboutToEnterWorld send: #restoreAcceleration to: self.
>>      self restoreAcceleration.
>>
>> also for WonderlandCameraMorph
>>>
>>> --Hannes
>
>
> Thank you for pointing this out, Bob.
>
> In Squeak 6.0a WebCamMorph is the only morph sending
>
>      #when:send:to:with:
>
>
> And there are only a few senders of
>
>      #triggerEvent:
>
> (see screen shot)
>
> So how would you, Bob,  suggest to proceed?
>
>
> --Hannes
>
>
>
>>>
>>> On 10/9/17, Marcel Taeumel <[hidden email]> wrote:
>>>> Hi Hannes,
>>>>
>>>> if you can manage to set-up the modal child (window), that removal
>>>> should
>>>> happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph
>>>> >>
>>>> #openModal:. For "control-flow-modality", instead, you should use a
>>>> DialogWindow. See DialogWindow >> #getUserResponse.
>>>>
>>>> Best,
>>>> Marcel
>>>> Am 09.10.2017 11:53:04 schrieb H. Hirzel <[hidden email]>:
>>>> Hello
>>>>
>>>> I start a separate thread for the issue brought up in the tread
>>>>
>>>> MorphicProject subclass: #EtoysProject
>>>>
>>>>
>>>> To see it in action make sure
>>>>
>>>> EToys-hjh.308.mcz
>>>>
>>>> is loaded. It contains a fix for the menuTitleBorderColor which makes
>>>> the following Etoys project load smoothly.
>>>>
>>>> Then drop the Etoys project file
>>>>
>>>> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>>>>
>>>> onto the desktop.
>>>>
>>>>
>>>>
>>>> When I choose 'World menu' -> 'Previous project', the following happens
>>>>
>>>>
>>>>
>>>>
>>>> ----------------------------------
>>>> Project class
>>>> ----------------------------------
>>>>
>>>> returnToPreviousProject
>>>> "Return to the project from which this project was entered. Do
>>>> nothing if the current project has no link to its previous project."
>>>>
>>>> | prevProj |
>>>> prevProj := CurrentProject previousProject.
>>>> prevProj ifNotNil: [prevProj enter: true revert: false
>>>> saveForRevert: false].
>>>>
>>>>
>>>>
>>>> ---------------------
>>>> MorphicProject(Project)
>>>>
>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>> "Install my ChangeSet, Transcript, and scheduled views as current
>>>> globals. If returningFlag is true, we will return to the project from
>>>> whence the current project was entered; don't change its
>>>> previousProject link in this case.
>>>> If saveForRevert is true, save the ImageSegment of the project
>>>> being left.
>>>> If revertFlag is true, make stubs for the world of the project
>>>> being left.
>>>> If revertWithoutAsking is true in the project being left, then
>>>> always revert."
>>>>
>>>> ......
>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>> .....
>>>>
>>>>
>>>> ----------------
>>>>
>>>> PasteUpMorph
>>>> --------------------
>>>>
>>>> triggerEvent: anEventSelector
>>>> "Evaluate all actions registered for . Return the
>>>> value of the last registered action."
>>>>
>>>> ^(self actionForEvent: anEventSelector) value
>>>>
>>>>
>>>> ------------------------
>>>> PasteUpMorph
>>>> ------------------------
>>>>
>>>>
>>>> removeModalWindow
>>>> self deprecated: 'The global becomeModal is no longer supported, use
>>>> e.g. a dialog window'.
>>>> "self modalWindow: nil"
>>>>
>>>>
>>>>
>>>> As mentioned in the thread
>>>> MorphicProject subclass: #EtoysProject
>>>> the issue may be "resolved" by just commenting out the deprecation
>>>> message.
>>>>
>>>>
>>>>
>>>> removeModalWindow
>>>>
>>>> "self deprecated: 'The global becomeModal is no longer supported, use
>>>> e.g. a dialog window'. "
>>>>
>>>> self flag: #fixMe.
>>>>
>>>> "self modalWindow: nil"
>>>>
>>>>
>>>>
>>>> Should we do this for the moment until is is more clear how the
>>>> navigation mechanism in Etoys works?
>>>>
>>>> Other suggestions?
>>>>
>>>>
>>>> Kind regards
>>>>
>>>> Hannes Hirzel
>>>>
>>>>
>>>>
>>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

marcel.taeumel
Hi Hannes,

it is likely that you have to clean-up some event maps in your image (resp. via Monticello post-load scripts for all other images).

Take a look at Object >> #actionMap. And in this case "PasteUpMorph allInstances collect: [:ea | ea actionMap]". In my image, it is the current world that has one action for "aboutToLeaveWorld" to #removeModalWindow.

It's not in the code, it's in the image state.

Best,
Marcel

Am 09.10.2017 15:55:36 schrieb H. Hirzel <[hidden email]>:

I need to do investigations how the Squeak 6 based etoys 2016 image by
Tim Felgentreff does this.

http://wiki.squeak.org/squeak/6531

...

On 10/9/17, H. Hirzel wrote:
> On 10/9/17, Bob Arning wrote:
>>
>>
>> On 10/9/17 9:13 AM, H. Hirzel wrote:
>>> Looking a bit further it seems that modal window probably are not the
>>> issue here
>>>
>>> MorphicProject(Project)
>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>
>>> ....
>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>> ....
>>>
>>>
>>> PasteUpMorph
>>> triggerEvent: anEventSelector
>>> "Evaluate all actions registered for . Return the
>>> value of the last registered action."
>>>
>>> ^(self actionForEvent: anEventSelector) value
>>>
>>>
>>> anEventSelector is #aboutToLeaveWorld
>>> and this is not implemented in PasteUpMorph.
>>>
>>> We have an empty block and that causes #removeModalWindow in a way I
>>> do not understand yet.
>>>
>>> But if we would have
>>>
>>> #aboutToLeaveWorld
>>>
>>> Then it we probably would not have this problem.
>>>
>>> I wonder #aboutToLeaveWorld where this comes form, Squeak 3.9 and
>>> Squeak 5.0 do not have it either.
>>
>> It's not a method, it's an event selector:
>>
>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>
>> WebCamMorph>>intoWorld: aWorld
>>
>>
>> super intoWorld: aWorld.
>> camIsOn ifTrue: [self on]
>> ifFalse:[self off].
>> self removeActionsForEvent: #aboutToEnterWorld.
>> aWorld
>> when: #aboutToLeaveWorld
>> send: #outOfWorld:
>> to: self
>> with: aWorld.
>>
>> similar stuff removed in the intervening years
>>
>> B3DSceneMorph>>intoWorld: aWorld
>>
>> "The receiver is showing in the given world"
>> aWorld ifNil:[^self].
>> super intoWorld: aWorld.
>> aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to: self.
>> aWorld when: #aboutToEnterWorld send: #restoreAcceleration to: self.
>> self restoreAcceleration.
>>
>> also for WonderlandCameraMorph
>>>
>>> --Hannes
>
>
> Thank you for pointing this out, Bob.
>
> In Squeak 6.0a WebCamMorph is the only morph sending
>
> #when:send:to:with:
>
>
> And there are only a few senders of
>
> #triggerEvent:
>
> (see screen shot)
>
> So how would you, Bob, suggest to proceed?
>
>
> --Hannes
>
>
>
>>>
>>> On 10/9/17, Marcel Taeumel wrote:
>>>> Hi Hannes,
>>>>
>>>> if you can manage to set-up the modal child (window), that removal
>>>> should
>>>> happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph
>>>> >>
>>>> #openModal:. For "control-flow-modality", instead, you should use a
>>>> DialogWindow. See DialogWindow >> #getUserResponse.
>>>>
>>>> Best,
>>>> Marcel
>>>> Am 09.10.2017 11:53:04 schrieb H. Hirzel :
>>>> Hello
>>>>
>>>> I start a separate thread for the issue brought up in the tread
>>>>
>>>> MorphicProject subclass: #EtoysProject
>>>>
>>>>
>>>> To see it in action make sure
>>>>
>>>> EToys-hjh.308.mcz
>>>>
>>>> is loaded. It contains a fix for the menuTitleBorderColor which makes
>>>> the following Etoys project load smoothly.
>>>>
>>>> Then drop the Etoys project file
>>>>
>>>> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>>>>
>>>> onto the desktop.
>>>>
>>>>
>>>>
>>>> When I choose 'World menu' -> 'Previous project', the following happens
>>>>
>>>>
>>>>
>>>>
>>>> ----------------------------------
>>>> Project class
>>>> ----------------------------------
>>>>
>>>> returnToPreviousProject
>>>> "Return to the project from which this project was entered. Do
>>>> nothing if the current project has no link to its previous project."
>>>>
>>>> | prevProj |
>>>> prevProj := CurrentProject previousProject.
>>>> prevProj ifNotNil: [prevProj enter: true revert: false
>>>> saveForRevert: false].
>>>>
>>>>
>>>>
>>>> ---------------------
>>>> MorphicProject(Project)
>>>>
>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>> "Install my ChangeSet, Transcript, and scheduled views as current
>>>> globals. If returningFlag is true, we will return to the project from
>>>> whence the current project was entered; don't change its
>>>> previousProject link in this case.
>>>> If saveForRevert is true, save the ImageSegment of the project
>>>> being left.
>>>> If revertFlag is true, make stubs for the world of the project
>>>> being left.
>>>> If revertWithoutAsking is true in the project being left, then
>>>> always revert."
>>>>
>>>> ......
>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>> .....
>>>>
>>>>
>>>> ----------------
>>>>
>>>> PasteUpMorph
>>>> --------------------
>>>>
>>>> triggerEvent: anEventSelector
>>>> "Evaluate all actions registered for . Return the
>>>> value of the last registered action."
>>>>
>>>> ^(self actionForEvent: anEventSelector) value
>>>>
>>>>
>>>> ------------------------
>>>> PasteUpMorph
>>>> ------------------------
>>>>
>>>>
>>>> removeModalWindow
>>>> self deprecated: 'The global becomeModal is no longer supported, use
>>>> e.g. a dialog window'.
>>>> "self modalWindow: nil"
>>>>
>>>>
>>>>
>>>> As mentioned in the thread
>>>> MorphicProject subclass: #EtoysProject
>>>> the issue may be "resolved" by just commenting out the deprecation
>>>> message.
>>>>
>>>>
>>>>
>>>> removeModalWindow
>>>>
>>>> "self deprecated: 'The global becomeModal is no longer supported, use
>>>> e.g. a dialog window'. "
>>>>
>>>> self flag: #fixMe.
>>>>
>>>> "self modalWindow: nil"
>>>>
>>>>
>>>>
>>>> Should we do this for the moment until is is more clear how the
>>>> navigation mechanism in Etoys works?
>>>>
>>>> Other suggestions?
>>>>
>>>>
>>>> Kind regards
>>>>
>>>> Hannes Hirzel
>>>>
>>>>
>>>>
>>>>
>>
>>
>



Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Bob Arning-2
In reply to this post by Hannes Hirzel

My iconoclastic view is to simply tone down the deprecation. If one cannot add a modal window, then attempting to remove one could be a silent no-op.


On 10/9/17 9:53 AM, H. Hirzel wrote:
On 10/9/17, Bob Arning [hidden email] wrote:

On 10/9/17 9:13 AM, H. Hirzel wrote:
Looking a bit further it seems that modal window probably are not the
issue here

MorphicProject(Project)
enter: returningFlag revert: revertFlag saveForRevert: saveForRevert

....
	CurrentProject world triggerEvent: #aboutToLeaveWorld.
....


PasteUpMorph
triggerEvent: anEventSelector
	"Evaluate all actions registered for <anEventSelector>. Return the
value of the last registered action."

     ^(self actionForEvent: anEventSelector) value


anEventSelector is #aboutToLeaveWorld
and this is not implemented in PasteUpMorph.

We have an empty block and that causes #removeModalWindow in a way I
do not understand yet.

But if we would have

     #aboutToLeaveWorld

Then it we probably would not have this problem.

I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
Squeak 5.0 do not have it either.
It's not a method, it's an event selector:

     CurrentProject world triggerEvent: #aboutToLeaveWorld.

WebCamMorph>>intoWorld: aWorld


     super intoWorld: aWorld.
     camIsOn ifTrue: [self on]
                     ifFalse:[self off].
     self removeActionsForEvent: #aboutToEnterWorld.
     aWorld
         when: #aboutToLeaveWorld
         send: #outOfWorld:
         to: self
         with: aWorld.

similar stuff removed in the intervening years

B3DSceneMorph>>intoWorld: aWorld

     "The receiver is showing in the given world"
     aWorld ifNil:[^self].
     super intoWorld: aWorld.
     aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to: self.
     aWorld when: #aboutToEnterWorld send: #restoreAcceleration to: self.
     self restoreAcceleration.

also for WonderlandCameraMorph
--Hannes

Thank you for pointing this out, Bob.

In Squeak 6.0a WebCamMorph is the only morph sending

     #when:send:to:with:


And there are only a few senders of

     #triggerEvent:

(see screen shot)

So how would you, Bob,  suggest to proceed?


--Hannes



On 10/9/17, Marcel Taeumel [hidden email] wrote:
Hi Hannes,

if you can manage to set-up the modal child (window), that removal
should
happen automatically. Use SystemWindow >> #modalLockTo:. Also see Morph

              
#openModal:. For "control-flow-modality", instead, you should use a
DialogWindow. See DialogWindow >> #getUserResponse.

Best,
Marcel
Am 09.10.2017 11:53:04 schrieb H. Hirzel [hidden email]:
Hello

I start a separate thread for the issue brought up in the tread

MorphicProject subclass: #EtoysProject


To see it in action make sure

EToys-hjh.308.mcz

is loaded. It contains a fix for the menuTitleBorderColor which makes
the following Etoys project load smoothly.

Then drop the Etoys project file

http://squeakland.org/content/articles/attach/FollowRoad.012.pr

onto the desktop.



When I choose 'World menu' -> 'Previous project', the following happens




----------------------------------
Project class
----------------------------------

returnToPreviousProject
"Return to the project from which this project was entered. Do
nothing if the current project has no link to its previous project."

| prevProj |
prevProj := CurrentProject previousProject.
prevProj ifNotNil: [prevProj enter: true revert: false
saveForRevert: false].



---------------------
MorphicProject(Project)

enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
"Install my ChangeSet, Transcript, and scheduled views as current
globals. If returningFlag is true, we will return to the project from
whence the current project was entered; don't change its
previousProject link in this case.
If saveForRevert is true, save the ImageSegment of the project
being left.
If revertFlag is true, make stubs for the world of the project
being left.
If revertWithoutAsking is true in the project being left, then
always revert."

......
CurrentProject world triggerEvent: #aboutToLeaveWorld.
.....


----------------

PasteUpMorph
--------------------

triggerEvent: anEventSelector
"Evaluate all actions registered for . Return the
value of the last registered action."

^(self actionForEvent: anEventSelector) value


------------------------
PasteUpMorph
------------------------


removeModalWindow
self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'.
"self modalWindow: nil"



As mentioned in the thread
MorphicProject subclass: #EtoysProject
the issue may be "resolved" by just commenting out the deprecation
message.



removeModalWindow

"self deprecated: 'The global becomeModal is no longer supported, use
e.g. a dialog window'. "

self flag: #fixMe.

"self modalWindow: nil"



Should we do this for the moment until is is more clear how the
navigation mechanism in Etoys works?

Other suggestions?


Kind regards

Hannes Hirzel








      



Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
In reply to this post by marcel.taeumel
On 10/9/17, Marcel Taeumel <[hidden email]> wrote:

> Hi Hannes,
>
> it is likely that you have to clean-up some event maps in your image (resp.
> via Monticello post-load scripts for all other images).
>
> Take a look at Object >> #actionMap. And in this case "PasteUpMorph
> allInstances collect: [:ea | ea actionMap]". In my image, it is the current
> world that has one action for "aboutToLeaveWorld" to #removeModalWindow.
>
> It's not in the code, it's in the image state.
>
> Best,
> Marcel


Thank you, Marcel,  for the explanation about the action map.
Yes, this is the source of the error.

In the loaded Etoys project I have a PasteUpMorph object as the desktop.

    Project current world a PasteUpMorph<world>(2880695) [world]


And this desktop object has an actionMap

    Project current world actionMap printString

'an IdentityDictionary(#aboutToLeaveWorld->WeakMessageSend(#removeModalWindow
-> a PasteUpMorph<world>(2880695) [world]) )'


If I do

    PasteUpMorph allInstances collect: [:ea | ea actionMap]

{an IdentityDictionary(#aboutToLeaveWorld->WeakMessageSend(#removeModalWindow
-> nil) ) . an IdentityDictionary() . an IdentityDictionary() . an
IdentityDictionary() . an IdentityDictionary() . an
IdentityDictionary() . an
IdentityDictionary(#aboutToLeaveWorld->WeakMessageSend(#removeModalWindow
-> a PasteUpMorph<world>(2880695) [world]) ) . an IdentityDictionary()
. an IdentityDictionary() . an IdentityDictionary() . an
IdentityDictionary()}


So most of the action maps are actually empty.

I am now looking for the proper place to remove the entry

     #aboutToLeaveWorld

from the action map of the currently loaded Etoys project.

That project is not loaded in a system window but occupies the whole desktop.

-- Hannes






Project current world actionMap printString 'an
IdentityDictionary(#aboutToLeaveWorld->WeakMessageSend(#removeModalWindow
-> a PasteUpMorph<world>(2880695) [world]) )'


> Am 09.10.2017 15:55:36 schrieb H. Hirzel <[hidden email]>:
> I need to do investigations how the Squeak 6 based etoys 2016 image by
> Tim Felgentreff does this.
>
> http://wiki.squeak.org/squeak/6531
>
> ...
>
> On 10/9/17, H. Hirzel wrote:
>> On 10/9/17, Bob Arning wrote:
>>>
>>>
>>> On 10/9/17 9:13 AM, H. Hirzel wrote:
>>>> Looking a bit further it seems that modal window probably are not the
>>>> issue here
>>>>
>>>> MorphicProject(Project)
>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>>
>>>> ....
>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>> ....
>>>>
>>>>
>>>> PasteUpMorph
>>>> triggerEvent: anEventSelector
>>>> "Evaluate all actions registered for . Return the
>>>> value of the last registered action."
>>>>
>>>> ^(self actionForEvent: anEventSelector) value
>>>>
>>>>
>>>> anEventSelector is #aboutToLeaveWorld
>>>> and this is not implemented in PasteUpMorph.
>>>>
>>>> We have an empty block and that causes #removeModalWindow in a way I
>>>> do not understand yet.
>>>>
>>>> But if we would have
>>>>
>>>> #aboutToLeaveWorld
>>>>
>>>> Then it we probably would not have this problem.
>>>>
>>>> I wonder #aboutToLeaveWorld where this comes form, Squeak 3.9 and
>>>> Squeak 5.0 do not have it either.
>>>
>>> It's not a method, it's an event selector:
>>>
>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>
>>> WebCamMorph>>intoWorld: aWorld
>>>
>>>
>>> super intoWorld: aWorld.
>>> camIsOn ifTrue: [self on]
>>> ifFalse:[self off].
>>> self removeActionsForEvent: #aboutToEnterWorld.
>>> aWorld
>>> when: #aboutToLeaveWorld
>>> send: #outOfWorld:
>>> to: self
>>> with: aWorld.
>>>
>>> similar stuff removed in the intervening years
>>>
>>> B3DSceneMorph>>intoWorld: aWorld
>>>
>>> "The receiver is showing in the given world"
>>> aWorld ifNil:[^self].
>>> super intoWorld: aWorld.
>>> aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to: self.
>>> aWorld when: #aboutToEnterWorld send: #restoreAcceleration to: self.
>>> self restoreAcceleration.
>>>
>>> also for WonderlandCameraMorph
>>>>
>>>> --Hannes
>>
>>
>> Thank you for pointing this out, Bob.
>>
>> In Squeak 6.0a WebCamMorph is the only morph sending
>>
>> #when:send:to:with:
>>
>>
>> And there are only a few senders of
>>
>> #triggerEvent:
>>
>> (see screen shot)
>>
>> So how would you, Bob, suggest to proceed?
>>
>>
>> --Hannes
>>
>>
>>
>>>>
>>>> On 10/9/17, Marcel Taeumel wrote:
>>>>> Hi Hannes,
>>>>>
>>>>> if you can manage to set-up the modal child (window), that removal
>>>>> should
>>>>> happen automatically. Use SystemWindow >> #modalLockTo:. Also see
>>>>> Morph
>>>>> >>
>>>>> #openModal:. For "control-flow-modality", instead, you should use a
>>>>> DialogWindow. See DialogWindow >> #getUserResponse.
>>>>>
>>>>> Best,
>>>>> Marcel
>>>>> Am 09.10.2017 11:53:04 schrieb H. Hirzel :
>>>>> Hello
>>>>>
>>>>> I start a separate thread for the issue brought up in the tread
>>>>>
>>>>> MorphicProject subclass: #EtoysProject
>>>>>
>>>>>
>>>>> To see it in action make sure
>>>>>
>>>>> EToys-hjh.308.mcz
>>>>>
>>>>> is loaded. It contains a fix for the menuTitleBorderColor which makes
>>>>> the following Etoys project load smoothly.
>>>>>
>>>>> Then drop the Etoys project file
>>>>>
>>>>> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>>>>>
>>>>> onto the desktop.
>>>>>
>>>>>
>>>>>
>>>>> When I choose 'World menu' -> 'Previous project', the following
>>>>> happens
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ----------------------------------
>>>>> Project class
>>>>> ----------------------------------
>>>>>
>>>>> returnToPreviousProject
>>>>> "Return to the project from which this project was entered. Do
>>>>> nothing if the current project has no link to its previous project."
>>>>>
>>>>> | prevProj |
>>>>> prevProj := CurrentProject previousProject.
>>>>> prevProj ifNotNil: [prevProj enter: true revert: false
>>>>> saveForRevert: false].
>>>>>
>>>>>
>>>>>
>>>>> ---------------------
>>>>> MorphicProject(Project)
>>>>>
>>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>>> "Install my ChangeSet, Transcript, and scheduled views as current
>>>>> globals. If returningFlag is true, we will return to the project from
>>>>> whence the current project was entered; don't change its
>>>>> previousProject link in this case.
>>>>> If saveForRevert is true, save the ImageSegment of the project
>>>>> being left.
>>>>> If revertFlag is true, make stubs for the world of the project
>>>>> being left.
>>>>> If revertWithoutAsking is true in the project being left, then
>>>>> always revert."
>>>>>
>>>>> ......
>>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>>> .....
>>>>>
>>>>>
>>>>> ----------------
>>>>>
>>>>> PasteUpMorph
>>>>> --------------------
>>>>>
>>>>> triggerEvent: anEventSelector
>>>>> "Evaluate all actions registered for . Return the
>>>>> value of the last registered action."
>>>>>
>>>>> ^(self actionForEvent: anEventSelector) value
>>>>>
>>>>>
>>>>> ------------------------
>>>>> PasteUpMorph
>>>>> ------------------------
>>>>>
>>>>>
>>>>> removeModalWindow
>>>>> self deprecated: 'The global becomeModal is no longer supported, use
>>>>> e.g. a dialog window'.
>>>>> "self modalWindow: nil"
>>>>>
>>>>>
>>>>>
>>>>> As mentioned in the thread
>>>>> MorphicProject subclass: #EtoysProject
>>>>> the issue may be "resolved" by just commenting out the deprecation
>>>>> message.
>>>>>
>>>>>
>>>>>
>>>>> removeModalWindow
>>>>>
>>>>> "self deprecated: 'The global becomeModal is no longer supported, use
>>>>> e.g. a dialog window'. "
>>>>>
>>>>> self flag: #fixMe.
>>>>>
>>>>> "self modalWindow: nil"
>>>>>
>>>>>
>>>>>
>>>>> Should we do this for the moment until is is more clear how the
>>>>> navigation mechanism in Etoys works?
>>>>>
>>>>> Other suggestions?
>>>>>
>>>>>
>>>>> Kind regards
>>>>>
>>>>> Hannes Hirzel
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
In reply to this post by Bob Arning-2
Hello Bob

On 10/9/17, Bob Arning <[hidden email]> wrote:
> My iconoclastic view is to simply tone down the deprecation. If one
> cannot add a modal window, then attempting to remove one could be a
> silent no-op.

I  thought of this too. And it works.

But see my email to Marcel.

I think it is better to do

     self world actionMap removeKey: #aboutToLeaveWorld

at the proper place. During the project loading somewhere.

Regards
Hannes

>
> On 10/9/17 9:53 AM, H. Hirzel wrote:
>> On 10/9/17, Bob Arning <[hidden email]> wrote:
>>>
>>> On 10/9/17 9:13 AM, H. Hirzel wrote:
>>>> Looking a bit further it seems that modal window probably are not the
>>>> issue here
>>>>
>>>> MorphicProject(Project)
>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>>
>>>> ....
>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>> ....
>>>>
>>>>
>>>> PasteUpMorph
>>>> triggerEvent: anEventSelector
>>>> "Evaluate all actions registered for <anEventSelector>. Return the
>>>> value of the last registered action."
>>>>
>>>>       ^(self actionForEvent: anEventSelector) value
>>>>
>>>>
>>>> anEventSelector is #aboutToLeaveWorld
>>>> and this is not implemented in PasteUpMorph.
>>>>
>>>> We have an empty block and that causes #removeModalWindow in a way I
>>>> do not understand yet.
>>>>
>>>> But if we would have
>>>>
>>>>       #aboutToLeaveWorld
>>>>
>>>> Then it we probably would not have this problem.
>>>>
>>>> I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
>>>> Squeak 5.0 do not have it either.
>>> It's not a method, it's an event selector:
>>>
>>>       CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>
>>> WebCamMorph>>intoWorld: aWorld
>>>
>>>
>>>       super intoWorld: aWorld.
>>>       camIsOn ifTrue: [self on]
>>>                       ifFalse:[self off].
>>>       self removeActionsForEvent: #aboutToEnterWorld.
>>>       aWorld
>>>           when: #aboutToLeaveWorld
>>>           send: #outOfWorld:
>>>           to: self
>>>           with: aWorld.
>>>
>>> similar stuff removed in the intervening years
>>>
>>> B3DSceneMorph>>intoWorld: aWorld
>>>
>>>       "The receiver is showing in the given world"
>>>       aWorld ifNil:[^self].
>>>       super intoWorld: aWorld.
>>>       aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to:
>>> self.
>>>       aWorld when: #aboutToEnterWorld send: #restoreAcceleration to:
>>> self.
>>>       self restoreAcceleration.
>>>
>>> also for WonderlandCameraMorph
>>>> --Hannes
>>
>> Thank you for pointing this out, Bob.
>>
>> In Squeak 6.0a WebCamMorph is the only morph sending
>>
>>       #when:send:to:with:
>>
>>
>> And there are only a few senders of
>>
>>       #triggerEvent:
>>
>> (see screen shot)
>>
>> So how would you, Bob,  suggest to proceed?
>>
>>
>> --Hannes
>>
>>
>>
>>>> On 10/9/17, Marcel Taeumel <[hidden email]> wrote:
>>>>> Hi Hannes,
>>>>>
>>>>> if you can manage to set-up the modal child (window), that removal
>>>>> should
>>>>> happen automatically. Use SystemWindow >> #modalLockTo:. Also see
>>>>> Morph
>>>>> #openModal:. For "control-flow-modality", instead, you should use a
>>>>> DialogWindow. See DialogWindow >> #getUserResponse.
>>>>>
>>>>> Best,
>>>>> Marcel
>>>>> Am 09.10.2017 11:53:04 schrieb H. Hirzel <[hidden email]>:
>>>>> Hello
>>>>>
>>>>> I start a separate thread for the issue brought up in the tread
>>>>>
>>>>> MorphicProject subclass: #EtoysProject
>>>>>
>>>>>
>>>>> To see it in action make sure
>>>>>
>>>>> EToys-hjh.308.mcz
>>>>>
>>>>> is loaded. It contains a fix for the menuTitleBorderColor which makes
>>>>> the following Etoys project load smoothly.
>>>>>
>>>>> Then drop the Etoys project file
>>>>>
>>>>> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>>>>>
>>>>> onto the desktop.
>>>>>
>>>>>
>>>>>
>>>>> When I choose 'World menu' -> 'Previous project', the following
>>>>> happens
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ----------------------------------
>>>>> Project class
>>>>> ----------------------------------
>>>>>
>>>>> returnToPreviousProject
>>>>> "Return to the project from which this project was entered. Do
>>>>> nothing if the current project has no link to its previous project."
>>>>>
>>>>> | prevProj |
>>>>> prevProj := CurrentProject previousProject.
>>>>> prevProj ifNotNil: [prevProj enter: true revert: false
>>>>> saveForRevert: false].
>>>>>
>>>>>
>>>>>
>>>>> ---------------------
>>>>> MorphicProject(Project)
>>>>>
>>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>>> "Install my ChangeSet, Transcript, and scheduled views as current
>>>>> globals. If returningFlag is true, we will return to the project from
>>>>> whence the current project was entered; don't change its
>>>>> previousProject link in this case.
>>>>> If saveForRevert is true, save the ImageSegment of the project
>>>>> being left.
>>>>> If revertFlag is true, make stubs for the world of the project
>>>>> being left.
>>>>> If revertWithoutAsking is true in the project being left, then
>>>>> always revert."
>>>>>
>>>>> ......
>>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>>> .....
>>>>>
>>>>>
>>>>> ----------------
>>>>>
>>>>> PasteUpMorph
>>>>> --------------------
>>>>>
>>>>> triggerEvent: anEventSelector
>>>>> "Evaluate all actions registered for . Return the
>>>>> value of the last registered action."
>>>>>
>>>>> ^(self actionForEvent: anEventSelector) value
>>>>>
>>>>>
>>>>> ------------------------
>>>>> PasteUpMorph
>>>>> ------------------------
>>>>>
>>>>>
>>>>> removeModalWindow
>>>>> self deprecated: 'The global becomeModal is no longer supported, use
>>>>> e.g. a dialog window'.
>>>>> "self modalWindow: nil"
>>>>>
>>>>>
>>>>>
>>>>> As mentioned in the thread
>>>>> MorphicProject subclass: #EtoysProject
>>>>> the issue may be "resolved" by just commenting out the deprecation
>>>>> message.
>>>>>
>>>>>
>>>>>
>>>>> removeModalWindow
>>>>>
>>>>> "self deprecated: 'The global becomeModal is no longer supported, use
>>>>> e.g. a dialog window'. "
>>>>>
>>>>> self flag: #fixMe.
>>>>>
>>>>> "self modalWindow: nil"
>>>>>
>>>>>
>>>>>
>>>>> Should we do this for the moment until is is more clear how the
>>>>> navigation mechanism in Etoys works?
>>>>>
>>>>> Other suggestions?
>>>>>
>>>>>
>>>>> Kind regards
>>>>>
>>>>> Hannes Hirzel
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: PasteUpMorph>>#removeModalWindow has been deprecated --- what do we need to do?

Hannes Hirzel
BTW the three Etoys projects loaded into my new Squeak 6.0a trunk
image (see last mail in the MorphicProject subclass: #EtoysProject
thread; only one fix) are in fact all instances

 MorphicProject

I did not reimplement the conversion to #EtoysProject.

HH

On 10/9/17, H. Hirzel <[hidden email]> wrote:

> Hello Bob
>
> On 10/9/17, Bob Arning <[hidden email]> wrote:
>> My iconoclastic view is to simply tone down the deprecation. If one
>> cannot add a modal window, then attempting to remove one could be a
>> silent no-op.
>
> I  thought of this too. And it works.
>
> But see my email to Marcel.
>
> I think it is better to do
>
>      self world actionMap removeKey: #aboutToLeaveWorld
>
> at the proper place. During the project loading somewhere.
>
> Regards
> Hannes
>
>>
>> On 10/9/17 9:53 AM, H. Hirzel wrote:
>>> On 10/9/17, Bob Arning <[hidden email]> wrote:
>>>>
>>>> On 10/9/17 9:13 AM, H. Hirzel wrote:
>>>>> Looking a bit further it seems that modal window probably are not the
>>>>> issue here
>>>>>
>>>>> MorphicProject(Project)
>>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>>>
>>>>> ....
>>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>>> ....
>>>>>
>>>>>
>>>>> PasteUpMorph
>>>>> triggerEvent: anEventSelector
>>>>> "Evaluate all actions registered for <anEventSelector>. Return the
>>>>> value of the last registered action."
>>>>>
>>>>>       ^(self actionForEvent: anEventSelector) value
>>>>>
>>>>>
>>>>> anEventSelector is #aboutToLeaveWorld
>>>>> and this is not implemented in PasteUpMorph.
>>>>>
>>>>> We have an empty block and that causes #removeModalWindow in a way I
>>>>> do not understand yet.
>>>>>
>>>>> But if we would have
>>>>>
>>>>>       #aboutToLeaveWorld
>>>>>
>>>>> Then it we probably would not have this problem.
>>>>>
>>>>> I wonder  #aboutToLeaveWorld  where this comes form, Squeak 3.9 and
>>>>> Squeak 5.0 do not have it either.
>>>> It's not a method, it's an event selector:
>>>>
>>>>       CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>>
>>>> WebCamMorph>>intoWorld: aWorld
>>>>
>>>>
>>>>       super intoWorld: aWorld.
>>>>       camIsOn ifTrue: [self on]
>>>>                       ifFalse:[self off].
>>>>       self removeActionsForEvent: #aboutToEnterWorld.
>>>>       aWorld
>>>>           when: #aboutToLeaveWorld
>>>>           send: #outOfWorld:
>>>>           to: self
>>>>           with: aWorld.
>>>>
>>>> similar stuff removed in the intervening years
>>>>
>>>> B3DSceneMorph>>intoWorld: aWorld
>>>>
>>>>       "The receiver is showing in the given world"
>>>>       aWorld ifNil:[^self].
>>>>       super intoWorld: aWorld.
>>>>       aWorld when: #aboutToLeaveWorld send: #suspendAcceleration to:
>>>> self.
>>>>       aWorld when: #aboutToEnterWorld send: #restoreAcceleration to:
>>>> self.
>>>>       self restoreAcceleration.
>>>>
>>>> also for WonderlandCameraMorph
>>>>> --Hannes
>>>
>>> Thank you for pointing this out, Bob.
>>>
>>> In Squeak 6.0a WebCamMorph is the only morph sending
>>>
>>>       #when:send:to:with:
>>>
>>>
>>> And there are only a few senders of
>>>
>>>       #triggerEvent:
>>>
>>> (see screen shot)
>>>
>>> So how would you, Bob,  suggest to proceed?
>>>
>>>
>>> --Hannes
>>>
>>>
>>>
>>>>> On 10/9/17, Marcel Taeumel <[hidden email]> wrote:
>>>>>> Hi Hannes,
>>>>>>
>>>>>> if you can manage to set-up the modal child (window), that removal
>>>>>> should
>>>>>> happen automatically. Use SystemWindow >> #modalLockTo:. Also see
>>>>>> Morph
>>>>>> #openModal:. For "control-flow-modality", instead, you should use a
>>>>>> DialogWindow. See DialogWindow >> #getUserResponse.
>>>>>>
>>>>>> Best,
>>>>>> Marcel
>>>>>> Am 09.10.2017 11:53:04 schrieb H. Hirzel <[hidden email]>:
>>>>>> Hello
>>>>>>
>>>>>> I start a separate thread for the issue brought up in the tread
>>>>>>
>>>>>> MorphicProject subclass: #EtoysProject
>>>>>>
>>>>>>
>>>>>> To see it in action make sure
>>>>>>
>>>>>> EToys-hjh.308.mcz
>>>>>>
>>>>>> is loaded. It contains a fix for the menuTitleBorderColor which makes
>>>>>> the following Etoys project load smoothly.
>>>>>>
>>>>>> Then drop the Etoys project file
>>>>>>
>>>>>> http://squeakland.org/content/articles/attach/FollowRoad.012.pr
>>>>>>
>>>>>> onto the desktop.
>>>>>>
>>>>>>
>>>>>>
>>>>>> When I choose 'World menu' -> 'Previous project', the following
>>>>>> happens
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> ----------------------------------
>>>>>> Project class
>>>>>> ----------------------------------
>>>>>>
>>>>>> returnToPreviousProject
>>>>>> "Return to the project from which this project was entered. Do
>>>>>> nothing if the current project has no link to its previous project."
>>>>>>
>>>>>> | prevProj |
>>>>>> prevProj := CurrentProject previousProject.
>>>>>> prevProj ifNotNil: [prevProj enter: true revert: false
>>>>>> saveForRevert: false].
>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------
>>>>>> MorphicProject(Project)
>>>>>>
>>>>>> enter: returningFlag revert: revertFlag saveForRevert: saveForRevert
>>>>>> "Install my ChangeSet, Transcript, and scheduled views as current
>>>>>> globals. If returningFlag is true, we will return to the project from
>>>>>> whence the current project was entered; don't change its
>>>>>> previousProject link in this case.
>>>>>> If saveForRevert is true, save the ImageSegment of the project
>>>>>> being left.
>>>>>> If revertFlag is true, make stubs for the world of the project
>>>>>> being left.
>>>>>> If revertWithoutAsking is true in the project being left, then
>>>>>> always revert."
>>>>>>
>>>>>> ......
>>>>>> CurrentProject world triggerEvent: #aboutToLeaveWorld.
>>>>>> .....
>>>>>>
>>>>>>
>>>>>> ----------------
>>>>>>
>>>>>> PasteUpMorph
>>>>>> --------------------
>>>>>>
>>>>>> triggerEvent: anEventSelector
>>>>>> "Evaluate all actions registered for . Return the
>>>>>> value of the last registered action."
>>>>>>
>>>>>> ^(self actionForEvent: anEventSelector) value
>>>>>>
>>>>>>
>>>>>> ------------------------
>>>>>> PasteUpMorph
>>>>>> ------------------------
>>>>>>
>>>>>>
>>>>>> removeModalWindow
>>>>>> self deprecated: 'The global becomeModal is no longer supported, use
>>>>>> e.g. a dialog window'.
>>>>>> "self modalWindow: nil"
>>>>>>
>>>>>>
>>>>>>
>>>>>> As mentioned in the thread
>>>>>> MorphicProject subclass: #EtoysProject
>>>>>> the issue may be "resolved" by just commenting out the deprecation
>>>>>> message.
>>>>>>
>>>>>>
>>>>>>
>>>>>> removeModalWindow
>>>>>>
>>>>>> "self deprecated: 'The global becomeModal is no longer supported, use
>>>>>> e.g. a dialog window'. "
>>>>>>
>>>>>> self flag: #fixMe.
>>>>>>
>>>>>> "self modalWindow: nil"
>>>>>>
>>>>>>
>>>>>>
>>>>>> Should we do this for the moment until is is more clear how the
>>>>>> navigation mechanism in Etoys works?
>>>>>>
>>>>>> Other suggestions?
>>>>>>
>>>>>>
>>>>>> Kind regards
>>>>>>
>>>>>> Hannes Hirzel
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>>
>>
>>
>



EtoysProjects_dropped_into_Squeak6.0a_2017-10-09.png (144K) Download Attachment