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@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 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! |
Aren't SystemWindows something ToolBuilder-specific anyway? But the
class is in Morphic, hmm... Am Di., 7. Apr. 2020 um 13:32 Uhr schrieb <[hidden email]>: > > 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@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 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! > > |
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 Mo., 20. Apr. 2020 um 18:08 Uhr schrieb Marcel Taeumel
<[hidden email]>: > > SystemWindow in Morphic is the pendant for SystemView in ST80. I mean, if it weren't for ToolBuilder, there would be no conceptual need for SystemWindow in Morphic, right? |
SystemWindow should actually be named SystemWindowMorph. It does exist outside ToolBuilder. You might be thinking of PluggableSystemWindow, which got added along with ToolBuilder. There is no independent (or generic) understanding of "window" reified as a class or object in Squeak yet. Independent from MVC or Morphic. Best, Marcel
|
Am Di., 21. Apr. 2020 um 16:56 Uhr schrieb Marcel Taeumel
<[hidden email]>: > > You might be thinking of PluggableSystemWindow Ah, I suppose that's true. :-) |
Hi Marcel,
> We can only use #openAsTool in #openInWindow if we manage to lift that concept from Morphic into the independent ToolBuilder or Tools package. Von: Squeak-dev <[hidden email]> im Auftrag von Jakob Reschke <[hidden email]>
Gesendet: Dienstag, 21. April 2020 17:34:00 An: The general-purpose Squeak developers list Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1644.mcz Am Di., 21. Apr. 2020 um 16:56 Uhr schrieb Marcel Taeumel
<[hidden email]>: > > You might be thinking of PluggableSystemWindow Ah, I suppose that's true. :-)
Carpe Squeak!
|
Free forum by Nabble | Edit this page |