
25.11.6 The Wizzy Set Method
The code for the set method is as follows:
Pkg_private Xv_opaque
wizzy_set_avlist(item, avlist)
Panel_item item; /* this object */
Attr_avlist avlist; /* attribute list */
{
Wizzy_private *dp = WIZZY_PRIVATE(item);
Xv_opaque result;
Rect value_rect;
Attr_attribute *attrs;
/* Parse panel item generic attributes before parsing Wizzy
* specific attributes and prevent panel_redisplay_item() from
* being called in item_set_avlist()
*/
if (*avlist != XV_END_CREATE) {
xv_set( dp->panel, PANEL_NO_REDISPLAY_ITEM, TRUE, NULL);
result = xv_super_avlist( item, &xv_wizzy_panel_pkg, avlist);
xv_set( dp->panel, PANEL_NO_REDISPLAY_ITEM, FALSE, NULL);
if (result != XV_OK)
return (result);
}
for ( attrs = avlist; *avlist; attrs = attr_next(attrs)) {
switch ( (int)attrs[0 ] ) {
case WIZZY_OFFSET:
dp->offset = attrs[1];
break;
case WIZZY_FLAG:
dp->flag = attrs[1];
break;
case XV_END_CREATE:
value_rect = *(Rect *)xv_get(item, PANEL_ITEM_VALUE_RECT);
rect_construct(&dp->block,
value_rect.r_left + dp->offset,
value_rect.r_top,
BLOCK_WIDTH, BLOCK_HEIGHT);
value_rect = rect_bounding(&value_rect, &dp->block);
/* Note: setting the value rect will cause the item
* item rect to be recalculated as the enclosing rect
* containing both the label and value rects.
*/
xv_set( item, PANEL_ITEM_VALUE_RECT, &value_rect,
624 XView Programming Manual