n/s/e/w scrollpane "best practices"
Adam Megacz <[email protected]>
| Newsgroups | gmane.comp.java.xwt.general |
|---|---|
| Organization | XWT |
| Message-ID | <[email protected]> |
> Charles Goodwin <[email protected]> writes: > > How else can you provide a reasonable syntax that accomplishes the following > > shape with the funcionality of a complex widget like scrollpane: > > ____________ > > | NORTH | > > ____|__________|_____ > > |W | |E | | > > |E | |A |-| > > |S | CENTER |S |-| > > |T | |T | | > > |___|__________|___|_| > > |SOUTH | > > |__________| > $scrollpane.north = myBoxNorth; > $scrollpane.south = myBoxSouth; If the number of cells in each axis is fixed at three, then this is a good solution. You can also do $scrollpane.children = { north: myNorth, south: mySouth, east: myEast, west: myWest } Otherwise, you should do something like $scrollpane[4][8] = myBoxFourCommaEight; In general, "boxes should stay where you put them". Charles: I certainly see why you's like to be able to treat _0 like all the other traps. It's seductively powerful. All I can say to this is that before the 20-Mar-2001 code release, I used to have this ability, and by using it, I managed to turn the message-threading code in mail.xwar into such an incomprehensible mess that I ended up throwing it all away and starting over. It's kinda like why modern languages (Python, ML, Java) don't have #define. It's an incredibly powerful mechanism, but it means that what you see and what the compiler sees can be totally different things. In our case, letting _0 be a "liar" trap or a __ trap would make it really, really hard to figure out what the engine sees just by looking at the .xwt file. For the record, I'm still not happy with the fact that all of a box's properties are 100% overridable and fakeable *except* for the numerical properties. It doesn't sit well with me. I'd like to come up with a solution at some point, but I'm pretty sure that liar/read traps on _0 aren't the answer. Child wrappers are "most" of the answer, but we're still not 100% there. Keep thinking on it... maybe you'll solve it for us! =) - a _______________________________________________ http://lists.xwt.org/listinfo/dev