NS_IF_RELEASE(child);
nsEventStatus PR_CALLBACK HandleEventMain(nsGUIEvent *aEvent){         //printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget);    nsEventStatus result = nsEventStatus_eConsumeNoDefault;    switch(aEvent->message) {                case NS_SIZE:        {            nsIEnumerator *enumer = aEvent->widget->GetChildren();            if (enumer) {                nsISupports *child;                if (NS_SUCCEEDED(enumer->CurrentItem(&child))) {                    nsIWidget *widget;                    if (NS_OK == child->QueryInterface(kIWidgetIID, (void**)&widget)) {                        widget->Resize(0, 0, 200,                           ((nsSizeEvent*)aEvent)->windowSize->height, PR_TRUE);                        NS_RELEASE(widget);                    }                }                NS_RELEASE(enumer);                delete enumer;            }            scribbleData.drawPane->Resize(200,                                0,                                ((nsSizeEvent*)aEvent)->windowSize->width - 200,                               ((nsSizeEvent*)aEvent)->windowSize->height,                               PR_TRUE);            break;        }        case NS_DESTROY:            printf("Destroy Window...Release window\n");            NS_IF_RELEASE(scribbleData.red);            NS_IF_RELEASE(scribbleData.green);            NS_IF_RELEASE(scribbleData.blue);            NS_IF_RELEASE(scribbleData.scribble);            NS_IF_RELEASE(scribbleData.lines);           // NS_RELEASE(scribbleData.drawPane);           // NS_RELEASE(scribbleData.mainWindow);             exit(0); // for now            break;        default:            result = nsEventStatus_eIgnore;    }    return result;}