Re: typeof
David Crawshaw <[email protected]> Wed, 9 Apr 2003 12:03:02 +1000
| Newsgroups | gmane.comp.java.xwt.general |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday, April 8, 2003, at 07:58 PM, Adam Megacz wrote: >> We need a function to test if a template has been applied to a box, at >> the very least. > > I'm a bit hesitant about this, because there's no way to fake it (like > traps)... That's a good reason against. I guess I'm still a little bit Object Oriented, and was looking for a version of Java's instanceof keyword. At the moment, I don't have an actual situation in which I have to introspect what templates have been applied to a box, but I can imagine such situations arising. I suppose we stick to logical attributes. Like determining if focusable has been preapplied by checking if the attribute focusable == true. Which can be faked. Not sure if we need a general attribute 'type' however for the different widget as Charlie is suggesting. Perhaps we should have a rule however that all adjective templates (-able) have a boolean attribute with the same name as the template, and set it to true when active. This is almost the case already. d _______________________________________________ http://lists.xwt.org/listinfo/dev