bool ColorSample::OnMouseButtonDown(int x, int y, Uint8 button) { ColorPicker *colorPicker = new ColorPicker(r, g, b); if(colorPicker->Wait() == OK_BUTTON) { setColor(colorPicker->getRed(), colorPicker->getGreen(), colorPicker->getBlue()); PostMessage(parent, COLOR_CHANGED); } delete colorPicker; return false; }