Block Closure Fix for window pane resizing

Anthony Hannan ajh18 at cornell.edu
Wed Jan 23 02:09:27 UTC 2002


I want to thank Jim Benson for tracking down the window pane bug.  The
attached changset fixes it.  It had to do with vars captured in doubly
nested blocks.  I forgot to consider that changes had to stick around in
case the outer block got reinvoked.  File-in
VarUsageFixPostConvert-ajh.cs if your already running the converted
block closure image, otherwise file-in VarUsageFix-ajh.cs after you file
in BCImageConversion-ajh.cs but before you convert.

Thanks,
Anthony

Jim Benson <jb at speed.net> wrote:
> Anthony,
> 
> I don't know exactly what's wrong with the morphic window pane resizing, but
> the routine:
> 
> paneWithLongestSide: sideBlock near: aPoint
>  | thePane theSide theLen box |
>  theLen _ 0.
>  paneMorphs do:
>   [:pane | box _ pane bounds.
>   box forPoint: aPoint closestSideDistLen:
>    [:side :dist :len |
>    (dist <= 5 and: [len > theLen]) ifTrue:
>     [thePane _ pane.
>     theSide _ side.
>     theLen _ len]]].
>  sideBlock value: theSide.
>  ^ thePane
> 
> seems to be the culprit. When you execute the routine, the instance variable
> theLen is never set to a value other than 0 under the new block context
> scheme. This routine attempts to cycle through the panes of the window and
> return the pane that is within 5 pixels of the point that is being checked
> and has the longest length if more than one pane borders the point.
> 
> In the case of a browser, the first pane checked is the bottom code pane (
> which should be the longest ) the the individual list panes are compared.
> However, the local variable theLen is never set correctly, so the last pane
> within the 5 pixel radius in the pane list is selected.
> 
> Thank you for your work on the block contexts, this is very useful.
> 
> Hope this helps,
> Jim Benson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VarUsageFixPostConvert-ajh.cs
Type: application/octet-stream
Size: 1864 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020122/87a3e603/VarUsageFixPostConvert-ajh.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VarUsageFix-ajh.cs
Type: application/octet-stream
Size: 1303 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020122/87a3e603/VarUsageFix-ajh.obj


More information about the Squeak-dev mailing list