A new version of Morphic was added to project The Inbox: http://source.squeak.org/inbox/Morphic-sjce.1465.mcz
==================== Summary ====================
Name: Morphic-sjce.1465 Author: sjce Time: 21 March 2019, 10:43:01.809481 pm UUID: f283ce64-3557-483a-971f-43ad678deef9 Ancestors: Morphic-eem.1464
Trying to open the debugger halo on the resulting window results in a MNU Text>>truncateWithElipsisTo: in HaloMorph>>doDebug:with:
Trying to grab the window results in a MNU Text>>truncateTo: in Morph>>nameForUndoWording that needs a similar change
=============== Diff against Morphic-eem.1464 ===============
Item was changed: ----- Method: HaloMorph>>doDebug:with: (in category 'private') ----- doDebug: evt with: menuHandle "Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target"
| menu | evt shiftPressed ifTrue: [ evt hand removeHalo. ^ innerTarget inspectInMorphic: evt].
menu := innerTarget buildDebugMenu: evt hand. + menu addTitle: (innerTarget externalName asString truncateWithElipsisTo: 40). - menu addTitle: (innerTarget externalName truncateWithElipsisTo: 40). menu popUpEvent: evt in: self world. evt hand removeHalo.!
Item was changed: ----- Method: Morph>>nameForUndoWording (in category 'dropping/grabbing') ----- nameForUndoWording "Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)"
| aName | aName := self knownName ifNil: [self renderedMorph class name]. + ^ aName asString truncateTo: 24! - ^ aName truncateTo: 24!
Do you have a reproducible case fixed by this commit? To me it seems to be a workaround for a mistake: a morph's name is a Text instead of a String.
Levente
On Thu, 21 Mar 2019, commits@source.squeak.org wrote:
A new version of Morphic was added to project The Inbox: http://source.squeak.org/inbox/Morphic-sjce.1465.mcz
==================== Summary ====================
Name: Morphic-sjce.1465 Author: sjce Time: 21 March 2019, 10:43:01.809481 pm UUID: f283ce64-3557-483a-971f-43ad678deef9 Ancestors: Morphic-eem.1464
Trying to open the debugger halo on the resulting window results in a MNU Text>>truncateWithElipsisTo: in HaloMorph>>doDebug:with:
Trying to grab the window results in a MNU Text>>truncateTo: in Morph>>nameForUndoWording that needs a similar change
=============== Diff against Morphic-eem.1464 ===============
Item was changed: ----- Method: HaloMorph>>doDebug:with: (in category 'private') ----- doDebug: evt with: menuHandle "Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target"
| menu | evt shiftPressed ifTrue: [ evt hand removeHalo. ^ innerTarget inspectInMorphic: evt].
menu := innerTarget buildDebugMenu: evt hand.
- menu addTitle: (innerTarget externalName asString truncateWithElipsisTo: 40).
- menu addTitle: (innerTarget externalName truncateWithElipsisTo: 40). menu popUpEvent: evt in: self world. evt hand removeHalo.!
Item was changed: ----- Method: Morph>>nameForUndoWording (in category 'dropping/grabbing') ----- nameForUndoWording "Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)"
| aName | aName := self knownName ifNil: [self renderedMorph class name].
- ^ aName asString truncateTo: 24!
- ^ aName truncateTo: 24!
Levente Uzonyi leves@caesar.elte.hu wrote:
Do you have a reproducible case fixed by this commit?
To me it seems to be a workaround for a mistake: a morph's name is a Text instead of a String.
‘Text’ asMorph openInWindowLabeled: ‘Text’ asText
You prefer additions to Text?
Stephan
On 3/22/19, Stephan Eggermont stephan@stack.nl wrote:
Levente Uzonyi leves@caesar.elte.hu wrote:
Do you have a reproducible case fixed by this commit?
To me it seems to be a workaround for a mistake: a morph's name is a Text instead of a String.
‘Text’ asMorph openInWindowLabeled: ‘Text’ asText
You prefer additions to Text?
Stephan
Hello Stephan
If I execute
'My text' asMorph openInWindowLabeled: 'My window' asText
in Squeak 5.3alpha 68021 I get a tiny window (see screen shot). If I want to grab it I get an error message. So window labels can not be texts.
'My text' asMorph openInWindowLabeled: 'My window' asString
does not exhibit this behaviour. However the window is black. So the coding idiom to open a Morph in a window with a particular label must be different.
http://wiki.squeak.org/squeak/6371 http://wiki.squeak.org/squeak/6347
have notes with some relevance for this issue.
For example #openInWindow: works fine. In class Morph #openInWindow: is implemented.
example:
p := PasteUpMorph new. p extent: 600@1000. p layoutPolicy: TableLayout new. p listDirection: #leftToRight. p wrapCentering: #topLeft. p wrapDirection: #topToBottom.
p layoutPolicy: TableLayout new; listDirection: #topToBottom; color: Color white. sp := ScrollPane new extent: 600@500. sp scroller addMorph: p.
Project allNames asSortedCollection do: [ :aName | p addMorph: (ProjectViewMorph on: (Project named: aName)) ]. p color: Color green.
sp openInWindow: 'Projects'. sp setScrollDeltas.
As Levente writes, the test case needs to be specified in more details. Different patches might be needed.
--Hannes
P.S. The screen shot mentioned in the previous mail.
On 3/22/19, H. Hirzel hannes.hirzel@gmail.com wrote:
On 3/22/19, Stephan Eggermont stephan@stack.nl wrote:
Levente Uzonyi leves@caesar.elte.hu wrote:
Do you have a reproducible case fixed by this commit?
To me it seems to be a workaround for a mistake: a morph's name is a Text instead of a String.
‘Text’ asMorph openInWindowLabeled: ‘Text’ asText
You prefer additions to Text?
Stephan
Hello Stephan
If I execute
'My text' asMorph openInWindowLabeled: 'My window' asText
in Squeak 5.3alpha 68021 I get a tiny window (see screen shot). If I want to grab it I get an error message. So window labels can not be texts.
'My text' asMorph openInWindowLabeled: 'My window' asString
does not exhibit this behaviour. However the window is black. So the coding idiom to open a Morph in a window with a particular label must be different.
http://wiki.squeak.org/squeak/6371 http://wiki.squeak.org/squeak/6347
have notes with some relevance for this issue.
For example #openInWindow: works fine. In class Morph #openInWindow: is implemented.
example:
p := PasteUpMorph new. p extent: 600@1000. p layoutPolicy: TableLayout new. p listDirection: #leftToRight. p wrapCentering: #topLeft. p wrapDirection: #topToBottom.
p layoutPolicy: TableLayout new; listDirection: #topToBottom; color: Color white. sp := ScrollPane new extent: 600@500. sp scroller addMorph: p.
Project allNames asSortedCollection do: [ :aName | p addMorph: (ProjectViewMorph on: (Project named: aName)) ]. p color: Color green.
sp openInWindow: 'Projects'. sp setScrollDeltas.
As Levente writes, the test case needs to be specified in more details. Different patches might be needed.
--Hannes
Three cases which work fine:
1.
((Morph new extent: 480@320; color: Color white) addMorph: 'my string' asMorph) openInWindowLabeled: '480x320 (HVGA) resolution'
2. If I do not indicate a color for the container morph then I get the default color for a new morph which is blue.
((Morph new extent: 480@320) addMorph: 'my string' asMorph) openInWindowLabeled: '480x320 (HVGA) resolution'
3. And if I do not give a morph extent then I get the default size, but the window works fine.
(Morph new addMorph: 'my string' asMorph) openInWindowLabeled: 'default morph object'
On 3/22/19, H. Hirzel hannes.hirzel@gmail.com wrote:
P.S. The screen shot mentioned in the previous mail.
On 3/22/19, H. Hirzel hannes.hirzel@gmail.com wrote:
On 3/22/19, Stephan Eggermont stephan@stack.nl wrote:
Levente Uzonyi leves@caesar.elte.hu wrote:
Do you have a reproducible case fixed by this commit?
To me it seems to be a workaround for a mistake: a morph's name is a Text instead of a String.
‘Text’ asMorph openInWindowLabeled: ‘Text’ asText
You prefer additions to Text?
Stephan
Hello Stephan
If I execute
'My text' asMorph openInWindowLabeled: 'My window' asText
in Squeak 5.3alpha 68021 I get a tiny window (see screen shot). If I want to grab it I get an error message. So window labels can not be texts.
'My text' asMorph openInWindowLabeled: 'My window' asString
does not exhibit this behaviour. However the window is black. So the coding idiom to open a Morph in a window with a particular label must be different.
http://wiki.squeak.org/squeak/6371 http://wiki.squeak.org/squeak/6347
have notes with some relevance for this issue.
For example #openInWindow: works fine. In class Morph #openInWindow: is implemented.
example:
p := PasteUpMorph new. p extent: 600@1000. p layoutPolicy: TableLayout new. p listDirection: #leftToRight. p wrapCentering: #topLeft. p wrapDirection: #topToBottom.
p layoutPolicy: TableLayout new; listDirection: #topToBottom; color: Color white. sp := ScrollPane new extent: 600@500. sp scroller addMorph: p.
Project allNames asSortedCollection do: [ :aName | p addMorph: (ProjectViewMorph on: (Project named: aName)) ]. p color: Color green.
sp openInWindow: 'Projects'. sp setScrollDeltas.
As Levente writes, the test case needs to be specified in more details. Different patches might be needed.
--Hannes
The attached change set fixes the case
Morph new openInWindowLabeled: 'Morph new'.
and also
(Morph new addMorph: 'My String' asMorph) openInWindowLabeled: 'My String'.
but not
'My String' asMorph openInWindowLabeled: 'My String'.
as the default color of the window which is opened is black.
---
The change set introduces a method
SystemWindow class>>minimumExtent "answer the minimum SystemWindow extent" ^ 160 @ 100
against which the extent of the morph object to be wrapped by the SystemWindow object is checked and if smaller the extent of the morph object is set to that minimum extent.
--HH
Hi, there.
Can we find better ways for supporting String protocols in Text objects? Maybe through DNU?
Best, Marcel Am 21.03.2019 22:43:16 schrieb commits@source.squeak.org commits@source.squeak.org: A new version of Morphic was added to project The Inbox: http://source.squeak.org/inbox/Morphic-sjce.1465.mcz
==================== Summary ====================
Name: Morphic-sjce.1465 Author: sjce Time: 21 March 2019, 10:43:01.809481 pm UUID: f283ce64-3557-483a-971f-43ad678deef9 Ancestors: Morphic-eem.1464
Trying to open the debugger halo on the resulting window results in a MNU Text>>truncateWithElipsisTo: in HaloMorph>>doDebug:with:
Trying to grab the window results in a MNU Text>>truncateTo: in Morph>>nameForUndoWording that needs a similar change
=============== Diff against Morphic-eem.1464 ===============
Item was changed: ----- Method: HaloMorph>>doDebug:with: (in category 'private') ----- doDebug: evt with: menuHandle "Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target"
| menu | evt shiftPressed ifTrue: [ evt hand removeHalo. ^ innerTarget inspectInMorphic: evt].
menu := innerTarget buildDebugMenu: evt hand. + menu addTitle: (innerTarget externalName asString truncateWithElipsisTo: 40). - menu addTitle: (innerTarget externalName truncateWithElipsisTo: 40). menu popUpEvent: evt in: self world. evt hand removeHalo.!
Item was changed: ----- Method: Morph>>nameForUndoWording (in category 'dropping/grabbing') ----- nameForUndoWording "Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)"
| aName | aName := self knownName ifNil: [self renderedMorph class name]. + ^ aName asString truncateTo: 24! - ^ aName truncateTo: 24!
On Mar 22, 2019, at 12:19 AM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi, there.
Can we find better ways for supporting String protocols in Text objects? Maybe through DNU?
Look at VisualWorks. I can’t remember how it’s solved there but it’s way better than Squeak. I *think* it introduces an abstract class CharacterArray above String & Text and moves as much protocol there as possible. MNU would be a horrible approach IMO.
Best, Marcel
Am 21.03.2019 22:43:16 schrieb commits@source.squeak.org commits@source.squeak.org:
A new version of Morphic was added to project The Inbox: http://source.squeak.org/inbox/Morphic-sjce.1465.mcz
==================== Summary ====================
Name: Morphic-sjce.1465 Author: sjce Time: 21 March 2019, 10:43:01.809481 pm UUID: f283ce64-3557-483a-971f-43ad678deef9 Ancestors: Morphic-eem.1464
Trying to open the debugger halo on the resulting window results in a MNU Text>>truncateWithElipsisTo: in HaloMorph>>doDebug:with:
Trying to grab the window results in a MNU Text>>truncateTo: in Morph>>nameForUndoWording that needs a similar change
=============== Diff against Morphic-eem.1464 ===============
Item was changed: ----- Method: HaloMorph>>doDebug:with: (in category 'private') ----- doDebug: evt with: menuHandle "Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target"
| menu | evt shiftPressed ifTrue: [ evt hand removeHalo. ^ innerTarget inspectInMorphic: evt].
menu := innerTarget buildDebugMenu: evt hand.
- menu addTitle: (innerTarget externalName asString truncateWithElipsisTo: 40).
- menu addTitle: (innerTarget externalName truncateWithElipsisTo: 40).
menu popUpEvent: evt in: self world. evt hand removeHalo.!
Item was changed: ----- Method: Morph>>nameForUndoWording (in category 'dropping/grabbing') ----- nameForUndoWording "Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)"
| aName | aName := self knownName ifNil: [self renderedMorph class name].
- ^ aName asString truncateTo: 24!
- ^ aName truncateTo: 24!
Hi Eliot,
yes, I would also prefer inheritance (e.g. CharacterArray between ArrayedCollection and String/Text) over MNU.
Best, Marcel Am 22.03.2019 15:37:02 schrieb Eliot Miranda eliot.miranda@gmail.com:
On Mar 22, 2019, at 12:19 AM, Marcel Taeumel <marcel.taeumel@hpi.de [mailto:marcel.taeumel@hpi.de]> wrote:
Hi, there.
Can we find better ways for supporting String protocols in Text objects? Maybe through DNU?
Look at VisualWorks. I can’t remember how it’s solved there but it’s way better than Squeak. I *think* it introduces an abstract class CharacterArray above String & Text and moves as much protocol there as possible. MNU would be a horrible approach IMO.
Best, Marcel Am 21.03.2019 22:43:16 schrieb commits@source.squeak.org [mailto:commits@source.squeak.org] <commits@source.squeak.org [mailto:commits@source.squeak.org]>: A new version of Morphic was added to project The Inbox: http://source.squeak.org/inbox/Morphic-sjce.1465.mcz [http://source.squeak.org/inbox/Morphic-sjce.1465.mcz]
==================== Summary ====================
Name: Morphic-sjce.1465 Author: sjce Time: 21 March 2019, 10:43:01.809481 pm UUID: f283ce64-3557-483a-971f-43ad678deef9 Ancestors: Morphic-eem.1464
Trying to open the debugger halo on the resulting window results in a MNU Text>>truncateWithElipsisTo: in HaloMorph>>doDebug:with:
Trying to grab the window results in a MNU Text>>truncateTo: in Morph>>nameForUndoWording that needs a similar change
=============== Diff against Morphic-eem.1464 ===============
Item was changed: ----- Method: HaloMorph>>doDebug:with: (in category 'private') ----- doDebug: evt with: menuHandle "Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target"
| menu | evt shiftPressed ifTrue: [ evt hand removeHalo. ^ innerTarget inspectInMorphic: evt].
menu := innerTarget buildDebugMenu: evt hand. + menu addTitle: (innerTarget externalName asString truncateWithElipsisTo: 40). - menu addTitle: (innerTarget externalName truncateWithElipsisTo: 40). menu popUpEvent: evt in: self world. evt hand removeHalo.!
Item was changed: ----- Method: Morph>>nameForUndoWording (in category 'dropping/grabbing') ----- nameForUndoWording "Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)"
| aName | aName := self knownName ifNil: [self renderedMorph class name]. + ^ aName asString truncateTo: 24! - ^ aName truncateTo: 24!
Hi all
On 25.03.2019, at 09:52, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi Eliot,
yes, I would also prefer inheritance (e.g. CharacterArray between ArrayedCollection and String/Text) over MNU.
If we go that way, lets do it slightly GemStone-compatible where (for other reasons, admittedly) String inherits from CharacterCollection (which is a SequenceableCollection).
I say slightly, because actually, Text there inherits from ArrayedCollection from when Dale ported that from Squeak to GemStone…
Best regards -Tobias
Best, Marcel
Am 22.03.2019 15:37:02 schrieb Eliot Miranda eliot.miranda@gmail.com:
On Mar 22, 2019, at 12:19 AM, Marcel Taeumel marcel.taeumel@hpi.de wrote:
Hi, there.
Can we find better ways for supporting String protocols in Text objects? Maybe through DNU?
Look at VisualWorks. I can’t remember how it’s solved there but it’s way better than Squeak. I *think* it introduces an abstract class CharacterArray above String & Text and moves as much protocol there as possible. MNU would be a horrible approach IMO.
Best, Marcel
Am 21.03.2019 22:43:16 schrieb commits@source.squeak.org commits@source.squeak.org:
A new version of Morphic was added to project The Inbox: http://source.squeak.org/inbox/Morphic-sjce.1465.mcz
==================== Summary ====================
Name: Morphic-sjce.1465 Author: sjce Time: 21 March 2019, 10:43:01.809481 pm UUID: f283ce64-3557-483a-971f-43ad678deef9 Ancestors: Morphic-eem.1464
Trying to open the debugger halo on the resulting window results in a MNU Text>>truncateWithElipsisTo: in HaloMorph>>doDebug:with:
Trying to grab the window results in a MNU Text>>truncateTo: in Morph>>nameForUndoWording that needs a similar change
=============== Diff against Morphic-eem.1464 ===============
Item was changed: ----- Method: HaloMorph>>doDebug:with: (in category 'private') ----- doDebug: evt with: menuHandle "Ask hand to invoke the a debugging menu for my inner target. If shift key is down, immediately put up an inspector on the inner target"
| menu | evt shiftPressed ifTrue: [ evt hand removeHalo. ^ innerTarget inspectInMorphic: evt].
menu := innerTarget buildDebugMenu: evt hand.
- menu addTitle: (innerTarget externalName asString truncateWithElipsisTo: 40).
- menu addTitle: (innerTarget externalName truncateWithElipsisTo: 40).
menu popUpEvent: evt in: self world. evt hand removeHalo.!
Item was changed: ----- Method: Morph>>nameForUndoWording (in category 'dropping/grabbing') ----- nameForUndoWording "Return wording appropriate to the receiver for use in an undo-related menu item (and perhaps elsewhere)"
| aName | aName := self knownName ifNil: [self renderedMorph class name].
- ^ aName asString truncateTo: 24!
- ^ aName truncateTo: 24!
squeak-dev@lists.squeakfoundation.org