[squeak-dev] The Trunk: Morphic-mt.1575.mcz
H. Hirzel
hannes.hirzel at gmail.com
Tue Oct 15 11:49:39 UTC 2019
Hi Marcel
With this fix you did here, this test now passes
1. Image Squeak5.3alpha latest update: #19124
2. Put a 'self halt' into the LazyListMorph >> #drawOn: method
3. The lists get red with a yellow X in the System Brower.
4. Ctrl plus stop brings you into an MVC project where you can revert
the 'self halt'
5. Jump back to the original project.
Result: The Morphic project is fixed after an error which caused the
GUI to stop.
Regards
Hannes
On Tue, 15 Oct 2019 11:30:30 0000, commits at source.squeak.org
<commits at source.squeak.org> wrote:
> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-mt.1575.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-mt.1575
> Author: mt
> Time: 15 October 2019, 1:30:24.148785 pm
> UUID: c7bde074-ddad-864a-a5b3-8b078736fe2f
> Ancestors: Morphic-mt.1574
>
> More robustness: (1) Catch both Error and Halt in Morphic drawing and (2)
> Reset drawing errors in morphs when restoring the Display.
>
> =============== Diff against Morphic-mt.1574 ===============
>
> Item was added:
> + ----- Method: MorphicProject>>restoreDisplay (in category 'scheduling &
> debugging') -----
> + restoreDisplay
> + "Give all morphs a chance to draw again."
> + self world ifNotNil: [:w | w allMorphsDo: [:ea | ea removeProperty:
> #errorOnDraw ]].
> +
> + super restoreDisplay.!
>
> Item was changed:
> ----- Method: WorldState>>displayWorldSafely: (in category 'update cycle')
> -----
> displayWorldSafely: aWorld
> "Update this world's display and keep track of errors during draw
> methods."
>
> | finished classesWithErrors |
> finished := false.
>
> [finished] whileFalse: [
> + [aWorld displayWorld. finished := true] on: Error, Halt do: [:ex |
> - [aWorld displayWorld. finished := true] on: Error do: [:ex |
> "Handle a drawing error"
> | err rcvr errCtx errMorph |
> err := ex description.
> rcvr := ex receiver.
>
> errCtx := thisContext.
> [
> errCtx := errCtx sender.
> "Search the sender chain to find the morph causing the problem"
> [errCtx notNil and:[(errCtx receiver isMorph) not]]
> whileTrue:[errCtx := errCtx sender].
> "If we're at the root of the context chain then we have a fatal
> drawing problem"
> errCtx ifNil:[^Project current fatalDrawingError: err].
> errMorph := errCtx receiver.
> "If the morph causing the problem has already the #drawError flag set,
> then search for the next morph above in the caller chain."
> errMorph hasProperty: #errorOnDraw
> ] whileTrue.
> errMorph setProperty: #errorOnDraw toValue: true.
>
> "Catch all errors, one for each receiver class."
> classesWithErrors ifNil: [classesWithErrors := IdentitySet new].
> (classesWithErrors includes: rcvr class) ifFalse: [
> classesWithErrors add: rcvr class.
> ToolSet debugException: ex].
>
> "Repaint all to catch all errors now and not if the debugger will
> appear."
> aWorld fullRepaintNeeded.
> ]].!
>
>
>
More information about the Squeak-dev
mailing list
|