[squeak-dev] computers too fast these days?
John McKeon
p3anoman at gmail.com
Wed Aug 21 13:30:21 UTC 2013
On Monday, Bob Arning wrote:
> If you look at: WorldState>>triggerAlarmsBefore:, you see the claim:
>
> "Trigger all pending alarms that are to be executed before nowTime."
>
> when, in fact, it triggers one at most:
>
> triggered := OrderedCollection new.
> self lockAlarmsDuring: [:pending |
> (pending isEmpty not and: [pending first scheduledTime < nowTime])
> ifTrue: [triggered add: pending removeFirst]].
> triggered do: [:alarm | alarm value: nowTime].
>
> makes me want to
>
> Smalltalk destroyAllComments ;-)
>
> Cheers,
> Bob
Whoops! That ifTrue: should be whileTrue:
John
>
> On 8/19/13 5:56 AM, Marcel Taeumel wrote:
>
> Hi! :)
>
> One point against blocking the event loop: You never know who will call
> #flash as it is public API. It is not guaranteed that the flashing morph
is
> "visible" at all and not occluded by some other morph. Then, strange short
> image freezes will be noticed.
>
> On 8/19/13 6:07 AM, Marcel Taeumel wrote:
>
> Here a better version:
>
> (self valueOfProperty: #colorBeforeFlashing ifAbsent: [self color])
> in: [:c |
> self setProperty: #colorBeforeFlashing toValue: c.
> self color: ((c ifNil: [Color white]) alpha: 1) negated.
> ActiveWorld displayWorldSafely.
>
> self
> removeAlarm: #color:;
> removeAlarm: #removeProperty:.
> self
> addAlarm: #color: with: c after: 100;
> addAlarm: #removeProperty: with: #colorBeforeFlashing after:
100].
>
> I am not exactly sure, why an explicit call to the render loop is
needed...
> But this way, it works without blocking the event loop. This "ActiveWorld
> displayWorldSafely" is still annoying...
>
> Best,
> Marcel
>
>
>
> --
> View this message in context:
http://forum.world.st/computers-too-fast-these-days-tp4704067p4704117.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>
>
>
--
jmck.seasidehosting.st
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20130821/56228689/attachment.htm
More information about the Squeak-dev
mailing list
|