[comp.windows.x] Constraint Class Question

bjoyce@coherent.com (Bob Joyce) (03/30/89)

Can the constraint_class.set_values procedure of a constraint widget C
assume that C's constraint_class.initialize procedure has already executed?

If so, C's widget children cannot call XtSetValues() in their
core_class.initialize procedure, even to set ordinary, non-constraint
resource values.  But calling XtSetValues() may be the easiest way for a
widget class to override default values specified by its superclasses.  

If not, how can C's constraint_class.set_values procedure know whether
a child's constraint data has been initialized?  

ben@hpcvlx.HP.COM (Benjamin Ellsworth) (04/01/89)

> ...But calling XtSetValues() may be the easiest way for a widget 
> class to override default values specified by its superclasses. ...

Nope.  The easiest way is to override the defaults in the default list.
For example, to override XtNborderWidth add the default to your 
resource list:

	{ XtNborderWidth,
	  XtCBorderWidth,
	  XtRDimension,
	  sizeof(Dimension),
	  XtOffset(MyWidgetClass, core.border_width),
	  XtRImmediate,
	  (caddr_t) 25,
	},

You can do that other stuff if you're careful, but I can't take the
time to explain all of the gory details right now, and with the above
solution, why bother?


-----------------------------------------------------------------------
Benjamin Ellsworth      | ben%hp-pcd@hp-sde.sde.hp.com | INTERNET
Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!ben | UUCP
1000 N.E. Circle        | (USA) (503) 750-4980         | FAX
Corvallis, OR 97330     | (USA) (503) 757-2000         | VOICE
-----------------------------------------------------------------------
                     All relevant disclaimers apply.
-----------------------------------------------------------------------