[squeak-dev] The Inbox: Morphic-ct.1644.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Apr 7 11:32:37 UTC 2020
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!
More information about the Squeak-dev
mailing list
|