diff --git a/include/wx/cocoa/window.h b/include/wx/cocoa/window.h index ff7205b96d..33e5df7836 100644 --- a/include/wx/cocoa/window.h +++ b/include/wx/cocoa/window.h @@ -141,6 +141,8 @@ public: virtual void SetFocus(); // Warp the pointer the given position virtual void WarpPointer(int x_pos, int y_pos) ; + // Change the window's cursor + virtual bool SetCursor( const wxCursor &cursor ); // Send the window a refresh event virtual void Refresh(bool eraseBack = true, const wxRect *rect = NULL); // Set/get the window's font diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index 1eba705a32..e79ae90549 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -595,6 +595,15 @@ void wxWindowCocoa::Cocoa_FrameChanged(void) GetEventHandler()->ProcessEvent(event); } +bool wxWindowCocoa::SetCursor(const wxCursor &cursor) +{ + if(!wxWindowBase::SetCursor(cursor)) + return false; + // Invalidate the cursor rects so the cursor will change + [[GetNSView() window] invalidateCursorRectsForView:GetNSView()]; + return true; +} + bool wxWindowCocoa::Cocoa_resetCursorRects() { if(!m_cursor.GetNSCursor())