Re: surface ++= ?

Charles Goodwin <[email protected]> Thu, 15 Apr 2004 22:02:55 +0000
Newsgroups gmane.comp.java.xwt.widgets
Organization XWT Foundation
Message-ID <[email protected]>
On Thu, 2004-04-15 at 17:39 -0400, Brian Alliet wrote:
> > Or, even better, we could just compare the 'surface' property from
> > within the core when a box changes parent, since that will support
> > self-emulation and dynamically generated surface objects.
> 
> That is what I was saying. The problem is Box.java doesn't know what 
> the surface property is. All it can do is call the appropriate traps to 
> find it.

That's what I'm advocating.

> If those traps return a different object each time you can't 
> tell when the surface has actually changed.

Arguably, that's a bad implementation of the surface object.

> That doesn't work. The value of the surface property comes from the 
> trap placed within surface.t. When you become a child of a new surface 
> you can't cascade back to the old one. We could put the *old* surface 
> value to surface then you could use cascade to get the *new* surface. 
> That seems kind of backwards though.

That is backwards and shouldn't be done.

> This shouldn't be this hard....

I hear ya.

To be honest, the passing 'true' method works fine because (how did I
not think of this, it's obvious) when a box changes surface, if it
wishes to remember the old surface for posterity then you could do:

var oldsurface;

surface ++= function(v) {
   /* blah */
   oldsurface = surface;
}

Next time surface is put to, you can simply revisit the old surface
through your 'oldsurface' variable.
-- 
- Charlie

Charles Goodwin <[email protected]>
Online @ www.charlietech.com