wxImage img;
if (!img.LoadFile(cursor_file, type))
return;
-
+
// eventually set the hotspot:
- if (!image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X))
+ if (!img.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X))
img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, hotSpotX);
- if (!image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y))
+ if (!img.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y))
img.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y, hotSpotY);
-
+
InitFromImage(img);
}
return wxCursor(wxCURSOR_WATCH);
}
-static void InternalIdle(const wxWindowList& list, GdkDisplay*& display)
+static void UpdateCursors(const wxWindowList& list, GdkDisplay*& display)
{
wxWindowList::const_iterator i = list.begin();
for (size_t n = list.size(); n--; ++i)
wxWindow* win = *i;
if (display == NULL && win->m_widget && win->m_widget->window)
display = gdk_drawable_get_display(win->m_widget->window);
- win->OnInternalIdle();
- InternalIdle(win->GetChildren(), display);
+ win->GTKUpdateCursor(true, false);
+ UpdateCursors(win->GetChildren(), display);
}
}
g_globalCursor = gs_savedCursor;
gs_savedCursor = wxNullCursor;
GdkDisplay* unused = NULL;
- InternalIdle(wxTopLevelWindows, unused);
+ UpdateCursors(wxTopLevelWindows, unused);
}
void wxBeginBusyCursor(const wxCursor* cursor)
gs_savedCursor = g_globalCursor;
g_globalCursor = *cursor;
GdkDisplay* display = NULL;
- InternalIdle(wxTopLevelWindows, display);
+ UpdateCursors(wxTopLevelWindows, display);
if (display)
gdk_display_flush(display);
}
void wxSetCursor( const wxCursor& cursor )
{
g_globalCursor = cursor;
- wxTheApp->WakeUpIdle();
+ GdkDisplay* unused = NULL;
+ UpdateCursors(wxTopLevelWindows, unused);
}