Re: Re: surface ++= ? (was on widgets@)
Charles Goodwin <[email protected]> Thu, 15 Apr 2004 23:01:36 +0000
| Newsgroups | gmane.comp.java.xwt.core |
|---|---|
| Organization | XWT Foundation |
| Message-ID | <[email protected]> |
Sounds good to me. It should be trivial to implement.
Also, as 'cascade' will return the new surface, it's worth mentioning if
you wish to get at the old surface from a surface trap then (in Ibex/JS)
you'll need to make an alternative note of the surface:
var oldsurface;
surface ++= function(v) {
/* do stuff against oldsurface */
oldsurface = surface;
}
(Also discussed on widgets@)
On Thu, 2004-04-15 at 18:47 -0400, Brian Alliet wrote:
> Ok. Here is my final proposal for making this whole mess work. If
> anybody has any comments please post them.
>
> When you *read* from the surface property the core simply returns
> parent.surface, or null if the get reaches the root box. To change the
> value of the surface property you have to trap it. (This is exactly how
> things work now).
>
> When you *write* to the surface property the core puts the value to the
> surface property of every child of the box. When a child with no
> children is reached the put is simply a no-op. Again, to do anything
> useful with the put you have to trap it.
>
> When a box's parent is going to change as a result of an add operation
> the core does a get on "surface" with the box still under its current
> parent, moves the box to the new parent, and does a get on "surface"
> again. If the old and new surface values differ it puts true to the
> surface property on the box (which in turn gets propagated to all its
> descendants).
>
> Widgets that need to know when their surface changes just have to put a
> *write* trap on surface. When that is written to they reregister with
> the focusmanager or whatever.
>
> -Brian
--
- Charlie
Charles Goodwin <[email protected]>
Online @ www.charlietech.com