printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget);
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 *next;                next = enumer->Next();                if (next) {                    nsIWidget *widget;                    if (NS_OK == next->QueryInterface(kIWidgetIID, (void**)&widget)) {                        widget->Resize(0, 0, 200, ((nsSizeEvent*)aEvent)->windowSize->height - 26, PR_TRUE);                        NS_RELEASE(widget);                    }                }                NS_RELEASE(enumer);                delete enumer;            }            scribbleData.drawPane->Resize(200,                                           0,                                           ((nsSizeEvent*)aEvent)->windowSize->width - 206,                                          ((nsSizeEvent*)aEvent)->windowSize->height - 26,                                          PR_TRUE);            break;        }        case NS_DESTROY:            printf("Destroy Window...Release window\n");            NS_RELEASE(scribbleData.red);            NS_RELEASE(scribbleData.green);            NS_RELEASE(scribbleData.blue);            NS_RELEASE(scribbleData.scribble);            NS_RELEASE(scribbleData.lines);           // NS_RELEASE(scribbleData.drawPane);           // NS_RELEASE(scribbleData.mainWindow);             exit(0); // for now            break;        default:            result = nsEventStatus_eIgnore;    }    return result;}