add: mPtr->view->delegate = &_MyWidgetDelegate;
context: CreateMyWidget(WMWidget *parent){    MyWidget *mPtr;        /* allocate some storage for our new widget instance */    mPtr = wmalloc(sizeof(MyWidget));    /* initialize it */    memset(mPtr, 0, sizeof(MyWidget));    /* set the class ID */    mPtr->widgetClass = myWidgetClass;        /*      * Create the view for our widget.     * Note: the Window for the view is only created after the view is     * realized with W_RealizeView()     *      * Consider the returned view as read-only.     */    mPtr->view = W_CreateView(W_VIEW(parent));    if (!mPtr->view) {	free(mPtr);	return NULL;    }    /* always do this */    mPtr->view->self = mPtr;    /*     * Intercept some events for our widget, so that we can handle them.     */    WMCreateEventHandler(mPtr->view, ExposureMask /* this allows us to know when we should paint */			 |StructureNotifyMask, /* this allows us to know things like when we are destroyed */			 handleEvents, mPtr);    /*     * Intercept some other events. This could be merged with the above     * call, but we separate for more organization.     */    WMCreateEventHandler(mPtr->view, ButtonPressMask,handleActionEvents, mPtr);    return mPtr;}