Re: typeof

Charles Goodwin <[email protected]> Mon, 7 Apr 2003 09:32:03 +0100
Newsgroups gmane.comp.java.xwt.general
Message-ID <308906BE5D07D5119285009027D61C5722F6BF@NTFPS1>
There are problems with this.

If you take the typeof from the name of the xwt (eg typeof( $mybutton ) ==
xwt.widget.button), it means nothing unless in the correct xwar context -
xwt.widget.button could be substituted for an xwt that is an image of a
naked lady but still be called xwt.widget.button.

It's all fairly arbitrary really.  It's probably best for us, as widget core
devs, to just put the type="widgetname" property on all our widgets.  Hell,
it's manual, but it's just as effective as a typeof() command.


-----Original Message-----
From: David Crawshaw [mailto:[email protected]]
Sent: 04 April 2003 23:12
To: [email protected]
Subject: Re: [xwt-dev] typeof



On Saturday, April 5, 2003, at 05:42  AM, Rod Martin wrote:
> Atm, typeof(somebox) simply returns 'object', which makes sense 
> because boxes
> are objects.  Is there another command I could be using, or could 
> typeof be
> overridden (is that even a word?) to implement something like this?

I asked for more introspection a long time ago, but we never formalised 
how to do it.

We need a function to test if a template has been applied to a box, at 
the very least.

You could have a function on Box called applied(templatename) that 
returns a boolean, but I suppose the word is a little too close to 
apply().

Give me a name, and I'll try and write a patch.

d


_______________________________________________
http://lists.xwt.org/listinfo/dev
_______________________________________________
http://lists.xwt.org/listinfo/dev