[squeak-dev] The Inbox: Morphic-ct.1644.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Apr 20 16:08:34 UTC 2020


SystemWindow in Morphic is the pendant for SystemView in ST80. We can only use #openAsTool in #openInWindow if we manage to lift that concept from Morphic into the independent ToolBuilder or Tools package. As long as "window" and "system window" are backed into Morphic framework, we should not use #openAsTool there.

Best,
Marcel
Am 11.04.2020 21:25:00 schrieb Jakob Reschke <forums.jakob at resfarm.de>:
Aren't SystemWindows something ToolBuilder-specific anyway? But the
class is in Morphic, hmm...

Am Di., 7. Apr. 2020 um 13:32 Uhr schrieb :
>
> Christoph Thiede uploaded a new version of Morphic to project The Inbox:
> http://source.squeak.org/inbox/Morphic-ct.1644.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-ct.1644
> Author: ct
> Time: 7 April 2020, 1:32:26.01443 pm
> UUID: a0c6db46-f0e7-0c44-85c1-04826d179915
> Ancestors: Morphic-mt.1643
>
> Proposal: Make #openInWindow... use #openAsTool rather than manual #addMorph.
>
> Advantage: Things like [CalendarMorph new openInWindow] follow the #openToolsAttachedToMouseCursor preference.
>
> Possible disadvantage: Dependency from Morphic to ToolBuilder-Morphic. Do we want this dependency? There is already a small number of dependencies in the same direction ...
>
> =============== Diff against Morphic-mt.1643 ===============
>
> Item was changed:
> ----- Method: Morph>>openInWindowLabeled:inWorld: (in category 'initialization') -----
> openInWindowLabeled: aString inWorld: aWorld
>
> + | window |
> + window := self wrapIntoWindowLabeled: aString inWorld: aWorld.
> + window openAsTool.
> + ^ window!
> - | window extent |
> -
> - window := (SystemWindow labelled: aString) model: nil.
> - window
> - " guess at initial extent"
> - bounds: (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
> - addMorph: self frame: (0 at 0 extent: 1 at 1);
> - updatePaneColors.
> - " calculate extent after adding in case any size related attributes were changed. Use
> - fullBounds in order to trigger re-layout of layout morphs"
> - extent := self fullBounds extent
> - + (window extent - window layoutBounds extent).
> - window extent: extent.
> - aWorld addMorph: window.
> - window beKeyWindow.
> - aWorld startSteppingSubmorphsOf: window.
> - ^window
> - !
>
> Item was added:
> + ----- Method: Morph>>wrapIntoWindowLabeled:inWorld: (in category 'initialization') -----
> + wrapIntoWindowLabeled: aString inWorld: aWorld
> +
> + | window extent |
> + window := (SystemWindow labelled: aString) model: nil.
> + window
> + "Guess at initial extent"
> + bounds: (RealEstateAgent initialFrameFor: window initialExtent: self fullBounds extent world: aWorld);
> + addMorph: self frame: (0 @ 0 extent: 1 @ 1);
> + updatePaneColors.
> +
> + "Calculate extent after adding in case any size related attributes were changed.
> + Use fullBounds in order to trigger re-layout of layout morphs."
> + extent := self fullBounds extent
> + + (window extent - window layoutBounds extent).
> + window extent: extent.
> +
> + aWorld startSteppingSubmorphsOf: window.
> +
> + ^ window!
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200420/632666bf/attachment.html>


More information about the Squeak-dev mailing list