Resource library RsrcFreeCicon() RsrcXload()
Programming guideline of WinDom

RsrcUserDraw()

NAME

RsrcUserDraw - set a drawing function to an object.

PROTOTYPAGE

int RsrcUserDraw ( int mode, WINDOW *win, int index, void (*draw)( WINDOW *, PARMBLK *, void *), void *data);

PARAMETERS

mode:
OC_FORM or OC_TOOLBAR,

win:
window descriptor,

index:
object index,

draw:
drawing function,

data:
pointer to an user data,

return:
0 if no error.

DESCRIPTION

RsrcUserDraw() attaches a drawing function to an object. AES will call the function draw to draw the object. A drawing function has the following interface:

     	void draw( WINDOW *win, PARMBLK *pblk, void *data);
win is the window descriptor of the window hosting the object, pblk contains informations related to the object and the USERDEF structure used (object state, clip area size, object previous and current state). data is a pointer to a user data specified by RsrcUserDraw(). The drawing function has the following limitation:

  1. objc_draw(), objc_change() and WinDom equivalent function cannot be used,

  2. do not use too many local variables : remenber this function is executed by the AES and then in supervisor mode,

  3. the drawing function should never clip screen because it is already performed by WinDom.

SEE ALSO

RsrcXtype()