Re: Using xwt.clone to theme
David Crawshaw <[email protected]> Wed, 28 Jan 2004 15:16:34 +1100
| Newsgroups | gmane.comp.java.xwt.widgets |
|---|---|
| Message-ID | <[email protected]> |
On 27/01/2004, at 2:25 PM, Charles Goodwin wrote:
> .xwt.theme = xwt.clone(.path.to.theme);
I don't think so. Last time I checked the idea was:
var new_xwt = xwt.clone(xwt);
new_xwt..xwt.theme ++= function() { return .path.to.theme; }
new_xwt..path.to.main(xwt.box);
This:
line 1 - creates a new xwt universe in variable new_xwt
line 2 - uses a read trap to replace xwt.theme with
specific theme inside the new universe
line 3 - applies the main template from the new universe
to a new box.
Whenever something inside the main template tries to reference
xwt.theme, it gets the result of the read trap we placed on
it, silently redirecting it to the theme of our choice.
Self-emulation is the idea.
d