[squeak-dev] The Trunk: Morphic-eem.1786.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Dec 13 08:39:25 UTC 2021


Hi Jakob, hi Eliot --

Yes, the project hierarchy can have both MVC and Morphic projects. I will take a look at it and try to make it more robust.

Best,
Marcel
Am 13.12.2021 01:55:34 schrieb Eliot Miranda <eliot.miranda at gmail.com>:


> On Dec 12, 2021, at 8:40 AM, Jakob Reschke wrote:
>
> Hi Eliot,
>
> I encountered an issue with the menu: apparently my image contains an
> unnamed project whose world is nil. Therefore I get a MNU: #submorphs
> whenever the new menu item gets selected (e. g. when the hand passes
> over it).
>
> Apart from that, it selects the top morphic project, but what if that
> transitively contains another MVC project, which would not understand
> #submorphs either? In fact, that unnamed project of mine is a Project
> (not a MorphicProject), though I do not know whether that ought to
> have a world anyway or not.
>
> Should we add nil checks and isMorphic checks

+1

> or do you have a different idea?

I’m not sure a generic exception handler is a good idea even if it is more general.

>
> Kind regards,
> Jakob
>
>> Am Do., 4. Nov. 2021 um 20:44 Uhr schrieb :
>>
>> Eliot Miranda uploaded a new version of Morphic to project The Trunk:
>> http://source.squeak.org/trunk/Morphic-eem.1786.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Morphic-eem.1786
>> Author: eem
>> Time: 4 November 2021, 12:44:06.340704 pm
>> UUID: 6a2f11a1-29ae-4254-b9a7-585512357c51
>> Ancestors: Morphic-mt.1785
>>
>> Add a Find Workspace... item to teh end of the Find Window menu. This finds and activates a workspace in any project (my life has too many projecvts with too many workspaces in them to lve without this kind of help).
>>
>> Abstracting the facility to search for other kinds of windows is left as an exercise to the reader (I don't see the need for being able to find other than workspaces, but that might be just me).
>>
>> Needs System-eem.1245.
>>
>> =============== Diff against Morphic-mt.1785 ===============
>>
>> Item was added:
>> + ----- Method: MorphicProject>>topMorphicProject (in category 'accessing') -----
>> + topMorphicProject
>> + parentProject == self ifTrue: [^self].
>> + parentProject ifNil: [self nilParentError].
>> + ^parentProject isMorphic
>> + ifTrue: [parentProject topMorphicProject]
>> + ifFalse: [self]!
>>
>> Item was changed:
>> ----- Method: TheWorldMainDockingBar>>listWindowsOn: (in category 'submenu - windows') -----
>> listWindowsOn: menu
>>
>> | windows |
>> windows := self allVisibleWindows sorted: [:winA :winB |
>> ((winA model isNil or: [winB model isNil]) or: [winA model name = winB model name])
>> ifTrue: [winA label
>> ifFalse: [winA model name
>> windows ifEmpty: [
>> menu addItem: [ :item |
>> item
>> contents: 'No Windows' translated;
>> isEnabled: false ] ].
>> windows do: [ :each |
>> | windowColor |
>> windowColor := (each model respondsTo: #windowColorToUse)
>> ifTrue: [each model windowColorToUse]
>> ifFalse: [UserInterfaceTheme current get: #uniformWindowColor for: Model].
>> menu addItem: [ :item |
>> item
>> contents: (self windowMenuItemLabelFor: each);
>> icon: (self colorIcon: windowColor);
>> target: each;
>> selector: #comeToFront;
>> subMenuUpdater: self
>> selector: #windowMenuFor:on:
>> arguments: { each };
>> action: [ each beKeyWindow; expand ] ] ].
>> menu
>> addLine;
>> add: 'Collapse all windows' target: (Project current world) selector: #collapseAllWindows;
>> add: 'Close all windows' target: self selector: #closeAllWindowsUnsafe;
>> addItem: [:item | item
>> contents: 'Close all windows without changes';
>> target: self;
>> icon: MenuIcons smallBroomIcon;
>> selector: #closeAllWindows];
>> + add: 'Close all windows but workspaces' target: self selector: #closeAllWindowsButWorkspaces;
>> + addItem:
>> + [ :item |
>> + item
>> + contents: 'Find Workspace...';
>> + target: self;
>> + selector: #findWorkspace;
>> + subMenuUpdater: self
>> + selector: #workspacesMenuFor:
>> + arguments: #()]!
>> - add: 'Close all windows but workspaces' target: self selector: #closeAllWindowsButWorkspaces.!
>>
>> Item was added:
>> + ----- Method: TheWorldMainDockingBar>>selectWorkspace:window:inProject:contents: (in category 'submenu - windows') -----
>> + selectWorkspace: aWorkspace window: aSystemWindow inProject: aMorphicProject contents: contents
>> + aMorphicProject
>> + addDeferredUIMessage: [aSystemWindow comeToFront];
>> + enter "Does nothing if already the current project..."
>> + !
>>
>> Item was added:
>> + ----- Method: TheWorldMainDockingBar>>workspacesMenuFor: (in category 'submenu - windows') -----
>> + workspacesMenuFor: anUpdatingMenuMorph
>> + | allWorkspaces |
>> + allWorkspaces := Set new.
>> + Project current topMorphicProject withChildrenDo:
>> + [:project|
>> + project world submorphs do:
>> + [:m|
>> + (m model isKindOf: Workspace) ifTrue:
>> + [allWorkspaces add:
>> + { m model.
>> + m.
>> + project.
>> + m model contents ifEmpty:
>> + [(m model dependents detect: [:d| d isTextView] ifNone: nil) textMorph contents] }]]].
>> + "Sort workspaces with non-empty ones first..."
>> + (allWorkspaces sorted:
>> + [:t1 :t2|
>> + t1 last isEmpty == t2 last isEmpty
>> + ifTrue: [t1 second label
>> + ifFalse: [t1 last notEmpty]]) do:
>> + [:tuple|
>> + anUpdatingMenuMorph addItem:
>> + [:item | item
>> + contents: tuple second label, ': ', (tuple last asString contractTo: 128);
>> + target: self;
>> + selector: #selectWorkspace:window:inProject:contents:;
>> + arguments: tuple]]!
>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211213/29e6258f/attachment.html>


More information about the Squeak-dev mailing list