@trixie
Quote:
The difference between the two BOOPSI setter functions is that SetGadgetAttrs() also triggers the GM_RENDER method to update the gadget imagery, while SetAttrs() simply sets the new value without the redraw. Typically, you'll use SetGadgetAttrs() in a live window to get immediate visual response, and SetAttrs() before the window opens (or when it's iconified).
That's not actually true.
The difference is that SetGadgetAttrs() populates the GadgetInfo entry in the opSet message (OM_SET)
struct opSet
{
ULONG MethodID;
struct TagItem *ops_AttrList; /* new attributes */
struct GadgetInfo *ops_GInfo; /* always there for gadgets,
* when SetGadgetAttrs() is used,
* but will be NULL for OM_NEW
*/
};
In reponse to the values of some attributes some but not all gadgets
may trigger a GM_RENDER . A very rough rule of thumb is that simple gadgets will render straight away, more complex ones may not. (but might still perform setup based on the GadgetInfo)
@Jabirulo
The difference with RefreshSetGadgetAttrs() is that it will *always* force a render of the gadget if SetGadgetAttrs() would have returned a non zero value.
It's equivelent of
if(SetGadgetAttrs()) RefreshGList() .
[edit]markdown and adding that the refresh only occurs if SetGadgetAttrs() would return non zero