[comp.windows.x.motif] Subclassing Motif ToggleButton Widget

collum@bryant.NCD.COM (Jim Collum) (10/23/90)

I am attempting to create a new widget by subclass the Motif ToggleButton
widget.  I need toggle functionality but a number of new resources for
each instance of the button. In doing so I have found a problem in the
way the expose (and a few other routines) were written and was wondering
if anyone with motif 1.1 sources can let me know if this has been taken
care of.

The ToggleButton (TB)  widget is a subclass of the Label widget and makes calls
to the Label widget's methods. As an example, the expose routine in the TB
is called Redisplay, and is declared as

static void Redisplay(w, event)
    Widget w;
    XEvent *event;
{
    register XmToggleButtonWidget tb = (XmToggleButtonWidget) w;


Within this procedure, the Label widget's expose routine is called via 

 (* tb->core.widget_class->core_class.superclass->core_class.expose) (tb)

If the TB widget becomes the superclass for my widget, and the expose
method is inherited, then the TB expose method ends up calling itself forever.

My assumption was that to allow for subclassing of a widget, the superclass
of the class record should be used rather than that of the passed widget. 
(ie
(*xmToggleButtonWidgetClass->core_class.superclass->core_class.expose)(tb);

).  Is this correct, and if so, has it been fixed for motif 1.1?


					thanks,

						jim collum