wxRect rect(nsrect.origin.x, ...); event->SetRect(rect); or just event->SetRect(wxRect(...));