printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget);
nsEventStatus PR_CALLBACK HandleEventText(nsGUIEvent *aEvent){    printf("aEvent->message %d on 0x%X\n", aEvent->message, aEvent->widget);    switch(aEvent->message) {        case NS_LOSTFOCUS:         {            nscolor color = scribbleData.drawPane->GetForegroundColor();            nsAutoString buf;                        nsITextWidget *text;            if (NS_OK == aEvent->widget->QueryInterface(kITextWidgetIID, (void**)&text)) {                if (text == scribbleData.red) {                    scribbleData.red->GetText(buf, 0);                    PRInt32 value, err;                    value = buf.ToInteger(&err);                    color = NS_RGB(value, NS_GET_G(color), NS_GET_B(color));                }                else if (text == scribbleData.green) {                    scribbleData.green->GetText(buf, 0);                    PRInt32 value, err;                    value = buf.ToInteger(&err);                    color = NS_RGB(NS_GET_R(color), value, NS_GET_B(color));                }                else if (text == scribbleData.blue) {                    scribbleData.blue->GetText(buf, 0);                    PRInt32 value, err;                    value = buf.ToInteger(&err);                    color = NS_RGB(NS_GET_R(color), NS_GET_G(color), value);                }                NS_RELEASE(text);            }            scribbleData.drawPane->SetForegroundColor(color);            return nsEventStatus_eIgnore;        }    }    return nsEventStatus_eIgnore;}