[REBOL] Re: win-offset? screen-offset? bug
From: brett:codeconscious at: 23-Mar-2002 15:05
Hi Romano,
> I find these standard functions wrong (beyond they have the same comment):
>
> win-offset?: func [
> screen-offset?: func [
> The problem is that they do not add the edge size of panels.
>
> Are I right?
Yes and no. The functions are correct in my opinion as they should not be
dependent on VID styles. I believe the problem is with panels/layout.
Look at this example code, the panel-face variable is pointing
to something that does not exist in the face object model.
view lyo: layout [
style button button 200x20
across
panel-face: panel 300x300 [
blue-box: box blue
red-box: box red
] edge [size: 5x5 color: orange]
green-face: box green
return
button "Move to phantom face" [
green-face/offset: win-offset? panel-face
show green-face
]
button "Move to actual panel face" [
green-face/offset: win-offset? lyo/pane/1
show green-face
]
]
Now have a look at these results:
>> panel-face/style
== panel
>> lyo/pane/1/style
== panel
>> lyo/pane/1/var
== panel-face
>> panel-face/var
== panel-face
>> equal? lyo/pane/1 panel-face
== false
>> panel-face/pane
== none
>> type? lyo/pane/1/pane
== block!
The panel-face variable appears to get set to some intermediate face made
during
the construction of the panel but which is not actually part of the final
face object
model.
I haven't worked out how to fix it but you can see a work around in the code
anyway.
Regards,
Brett