next up previous contents index
Next: 4. The NoGeoRequest Method Up: 2. The Implementation Previous: 2. The Class Structure   Contents   Index

3. The set_values() Method

In any interesting widget, the set_values() method will probably do something (but it doesn't in Trivial.c). The code below can be considered boilerplate; you should probably base a subclass's set_values() method on this code. Note especially the region reserved for setting class specific instance variables.

static Boolean
set_values(Widget old,
           Widget request,
           Widget new,
           ArgList args,
           Cardinal *num_args)
    Boolean refresh_needed = False;

!    BB_InSetValues(new) = True;!
    /* do any class specific stuff HERE */
!    BB_InSetValues(new) = False;!

!    if (refresh_needed && (XtClass(new) == xmTrivialWidgetClass))
        return False;
    return refresh_needed;

Danny Backx