static gboolean handle_btn1(Annotation *annotation, Property *prop) { Color col; text_get_attributes(annotation->text,&annotation->attrs); col = annotation->attrs.color; /* g_message("in handle_btn1 for object %p col=%.2f:%.2f:%.2f", annotation,col.red,col.green,col.blue); */ col.red = g_random_double(); col.green = g_random_double(); col.blue = g_random_double(); annotation->attrs.color = col; text_set_attributes(annotation->text,&annotation->attrs); /* g_message("end of handle_btn1 for object %p col=%.2f:%.2f:%.2f", annotation,col.red,col.green,col.blue); */ return TRUE; }
gboolean apply_textattr_properties(GPtrArray *props, Text *text, const gchar *textname, TextAttributes *attrs) { TextProperty *textprop = (TextProperty *)find_prop_by_name_and_type(props,textname,PROP_TYPE_TEXT); if ((!textprop) || ((textprop->common.experience & (PXP_LOADED|PXP_SFO))==0 )) { /* most likely we're called after the dialog box has been applied */ text_set_attributes(text,attrs); return TRUE; } return FALSE; }