Path: utzoo!attcan!uunet!mcvax!ukc!harrier.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: Problem subclassing from a constraint class widget in the X Toolkit Message-ID: <544@harrier.ukc.ac.uk> Date: 2 Apr 89 13:31:23 GMT Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 40 I have a Radio Form widget which is subclassed from the Athena Form widget. The Form widget is a subclass of Constraint and therefore it has the following constraint class part fields in the widget class structure: /* subresources */ formConstraintResources, /* subresource_count */ XtNumber(formConstraintResources), /* constraint_size */ sizeof(FormConstraintsRec), /* initialize */ ConstraintInitialize, /* destroy */ NULL, /* set_values */ ConstraintSetValues, /* extension */ NULL, Now I want to inherit these fields because I don't want to add anymore constraints. So I thought I could do this the same way I inherit from the composite class, i.e. XtInheritGeometryManager, but the constraint widget does not implement any of the required XtInherit hooks in its instance initialization procedure. What I want is the following: XtInheritConstraintResources XtInheritNumberConstraintResources XtInheritConstraintSize XtInheritConstraintInitialize XtInheritConstraintDestroy XtInheritConstraintSetValues Why where these (or something similar) not put in the constraint widget? At the moment I have to do what I consider a horrible kludge. I have to explicitly set the constraint_class fields to the those given above for the Form Widget. PLUS I have to implement the ConstraintInitialize and ConstraintSetValues calls in the Radio Form even though they are identical to the same named procedures in the Form Widget. Please will someone tell me I am stupid and can do what I want in a more elegant and sensibly way. Thanks. Richard Hesketh : rlh2@ukc.ac.uk ..!mcvax!ukc!rlh2 --- Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, England.