Adding a New Object

Adrian Phillips - Tandem User (tandem@typhoon.oslo.dnmi.no)
04 May 1994 08:46:45 GMT

Hi all,

I'm trying to get XChangeWindowAttributes hacked in. The call requires
a XSetWindowAttributes struct, which means pack will have to be used
but I don't like haveing to do this for something like the X
structures if an object can be used in place of the structure.

What would be better IMHO is to be able to create an object -
XSetWindowAttibutes - which will have the various structure members as
object members. So you could do: NewSWA = XSetWindowAttributes () to
create a new instance of this object, then fill in those members that
you want to for the call to XChangeWindowAtributes. This concept could
be used for all (or most) of the various X structures, e.g. XEvents.
you could then write:
NewSWA.cursor = XC_watch
Xlib.CreateChangeWindowAttributes (NewSWA)

Now I've checked the xxobject.c file and presumably you se the setattr
part of the typeobject struct for filling in object values. But how do
you tie this with the above example, ie. what happens with this line:
NewSWA.cursor = XC_watch
wih regards setattr fucntion call:
static int
xx_setattr(xp, name, v)
xxobject *xp;
char *name;
object *v;
{

I'm somewhat confused by all this, presuambly because my idea of an
object isn't quite straight. Perhaps someone can clear this up for me.

Thanks,

Adrian

--
-------------------------------------------------------------------------
= Adrian Phillips at            | BUT any thoughts in this are purely    =
= The Norwegian Meteorological  | my own and have nothing to do with     =
= Institute   	    	        | this establishment, thankfully.        =
= Net: adrian.phillips@dnmi.no  | Phone: 47 22 96 32 09 Fax: 47 22 96 30 50