The goal of these objects is to provide an easy way to draw something in a formular or a toolbar inside a window. Drawing inside classical GEM formular is not possible.
To attribute a drawing function to an object, you have to use the RsrcUserDraw() function. This function transforms the object in a special extended type (255) format. After this call, the AES will call the function given to RsrcUserDraw() to draw the object. The function given to RsrcUserDraw() - that we call the UserDraw function - and the Userdef function are differents. Actually, the Userdef function calls the drawing function to draw the object. The main raison of this system is that the drawing function is similar to a standard drawing function of a window (i.e. the function called by WM_REDRAW), but there are some differences:
Example
/* A typical userdraw function : a simple text */
void MyUserDraw( WINDOW *win, PARMBLK *pblk) { char *p;
A FINIR }