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

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Sat Jan 29 21:08:15 UTC 2022


Hi Marcel,

what issues would you be thinking of? There might be visual glitches in a few senders that relied on a short delay by #flash, but I would consider the current implementation a visual glitch anyway. ;-) Other than that, there is the hypothetical possibility that a sender would invalidate itself right after #flash, this would hurt indeed. I am open to introduce my change in a new selector #flushAsync if you think this is an issue.

Regarding the future send: Ah, I just learned that this will still make sure that the promise is only resolved on the UI process. Sounds like a nice application example for promises then. :-)

Best,
Christoph

PS: What do you think, should we also override Object >> #flash on Model to do "self changed: #flash"? :-)

---
Sent from Squeak Inbox Talk

On 2022-01-28T08:36:14+01:00, marcel.taeumel at hpi.de wrote:

> Hi Christoph --
> 
> I am aware of the current drawbacks of #flash. If you want to change it's behavior, please elaborate on the possible issues first. If the worst that might happen is a single debugger, then we are fine.
> 
> Still, instead of 
> 
> self addAlarm: #color: with: originalColor after: 20 "milliSeconds"
> 
> 
> I would write:
> 
> (self future: 20 "milliseconds") color: originalColor.
> 
> But any way is okay, I suppose.
> 
> Best,
> 
> Marcel
> Am 27.01.2022 17:38:57 schrieb Thiede, Christoph <christoph.thiede at student.hpi.uni-potsdam.de>:
> Hi Marcel,
> 
> #flash is broadcasted by some models to possibly many morphs, so I think a synchronous call comes with the drawback of unnecessarily slowing down the system for each invocation. How would you think of a separate new #flashAsync for this use case? :-)
> 
> Best,
> Christoph
> Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
> Gesendet: Donnerstag, 27. Januar 2022 11:09:28
> An: squeak-dev
> Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1859.mcz
>  
> Hi Christoph --
> 
> -1
> 
> Please don't make a synchronous call async like this. Add a busyWait if you like, but no Morphic alarm.
> 
> Best,
> Marcel
> Am 26.01.2022 21:50:31 schrieb commits at source.squeak.org <commits at source.squeak.org>:
> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-ct.1859.mcz
> 
> ==================== Summary ====================
> 
> Name: Morphic-ct.1859
> Author: ct
> Time: 26 January 2022, 9:50:11.019407 pm
> UUID: 83e57c24-b685-2a4a-ac5a-ad0df51bba9d
> Ancestors: Morphic-mt.1858
> 
> Proposal: Makes #flash more visible by
> a) using a morphic alarm to ensure that the flash also appears on fast machines (on my machine, it did not always appear before else)
> b) having system windows participate in a flash requested by a model too.
> 
> =============== Diff against Morphic-mt.1858 ===============
> 
> Item was changed:
> ----- Method: Morph>>flash (in category 'macpal') -----
> flash
> | originalColor |
> originalColor := self color.
> + self color:
> - [ self color:
> (originalColor
> ifNil: [ Color black ]
> + ifNotNil: [( (originalColor alpha: 1) adjustSaturation: 0.8 brightness: 0) negated ]).
> + self refreshWorld.
> + self addAlarm: #color: with: originalColor after: 20 "milliSeconds".!
> - ifNotNil: [( (originalColor alpha: 1) adjustSaturation: 0.8 brightness: 0) negated ]) ]
> - ensure:
> - [ self refreshWorld.
> - self color: originalColor ]!
> 
> Item was changed:
> ----- Method: SystemWindow>>update: (in category 'label') -----
> update: aSymbol
> aSymbol = #relabel
> ifTrue: [^ model ifNotNil: [ self setLabel: model labelString ] ].
> aSymbol = #close
> + ifTrue: [self delete].
> + aSymbol = #flash
> + ifTrue: [self flash].!
> - ifTrue: [self delete]!
> 
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220128/d97198d7/attachment.html>
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220129/9a3c5e39/attachment.html>


More information about the Squeak-dev mailing list