doLayoutIn: killing the image
Hi In this method I just added Transcript show: '.'. and tried to open a transcript and it freezes the image systematically :( Any ideas why? Stef doLayoutIn: layoutBounds "Compute a new layout based on the given layout bounds." "Note: Testing for #bounds or #layoutBounds would be sufficient to figure out if we need an invalidation afterwards but #outerBounds is what we need for all leaf nodes so we use that." | layout box priorBounds | priorBounds := self outerBounds. submorphs isEmpty ifTrue: [^fullBounds := priorBounds]. "Send #ownerChanged to our children" submorphs do: [:m | m ownerChanged]. layout := self layoutPolicy. layout ifNotNil: [layout layout: self in: layoutBounds]. self adjustLayoutBounds. fullBounds := self privateFullBounds. box := self outerBounds. box = priorBounds ifFalse: [self invalidRect: (priorBounds quickMerge: box)]
probably that show: invokes somehow doLayoutIn: Stef On Aug 15, 2013, at 10:23 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi
In this method I just added Transcript show: '.'. and tried to open a transcript and it freezes the image systematically :( Any ideas why?
Stef
doLayoutIn: layoutBounds "Compute a new layout based on the given layout bounds."
"Note: Testing for #bounds or #layoutBounds would be sufficient to figure out if we need an invalidation afterwards but #outerBounds is what we need for all leaf nodes so we use that."
| layout box priorBounds | priorBounds := self outerBounds. submorphs isEmpty ifTrue: [^fullBounds := priorBounds]. "Send #ownerChanged to our children" submorphs do: [:m | m ownerChanged]. layout := self layoutPolicy. layout ifNotNil: [layout layout: self in: layoutBounds]. self adjustLayoutBounds. fullBounds := self privateFullBounds. box := self outerBounds. box = priorBounds ifFalse: [self invalidRect: (priorBounds quickMerge: box)]
On Aug 15, 2013, at 10:45 , Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
probably that show: invokes somehow doLayoutIn:
Stef
Yes, when you show something on screen, its layout usually has to be computed first. To be on the safe side, never use anything but #haltOnce to debug graphics code, or you WILL end up in infinite loops hanging your image really, really often. Which should also answer your question of why can interrupt the UI process, it's the only foolproof way to debug UI code in a familiar way ;) Cheers, Henry
On Aug 15, 2013, at 11:42 AM, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
On Aug 15, 2013, at 10:45 , Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
probably that show: invokes somehow doLayoutIn:
Stef
Yes, when you show something on screen, its layout usually has to be computed first. To be on the safe side, never use anything but #haltOnce to debug graphics code, or you WILL end up in infinite loops hanging your image really, really often. Which should also answer your question of why can interrupt the UI process, it's the only foolproof way to debug UI code in a familiar way ;)
;) I did that. I imagine that I will also try haltIf: and friends.
Cheers, Henry
try to switch to the old debugger and retry. Smalltalk tools register: Debugger as: #debugger. might be related to the image crash. Le 15 août 2013 10:45, "Stéphane Ducasse" <stephane.ducasse@inria.fr> a écrit :
probably that show: invokes somehow doLayoutIn:
Stef
On Aug 15, 2013, at 10:23 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Hi
In this method I just added Transcript show: '.'. and tried to open a transcript and it freezes the image systematically :( Any ideas why?
Stef
doLayoutIn: layoutBounds "Compute a new layout based on the given layout bounds."
"Note: Testing for #bounds or #layoutBounds would be sufficient to figure out if we need an invalidation afterwards but #outerBounds is what we need for all leaf nodes so we use that."
| layout box priorBounds | priorBounds := self outerBounds. submorphs isEmpty ifTrue: [^fullBounds := priorBounds]. "Send #ownerChanged to our children" submorphs do: [:m | m ownerChanged]. layout := self layoutPolicy. layout ifNotNil: [layout layout: self in: layoutBounds]. self adjustLayoutBounds. fullBounds := self privateFullBounds. box := self outerBounds. box = priorBounds ifFalse: [self invalidRect: (priorBounds quickMerge: box)]
participants (3)
-
Clément Bera -
Henrik Johansen -
Stéphane Ducasse