Changed wxRootWindow from a global to a staic variable with an

accessor function that initializes if on first use.  This prevents
core dumps for apps that try to create wxBitmaps before the wxApp
object is initialized.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-05-11 17:55:28 +00:00
parent a90c95aa8e
commit c2fa61e833
12 changed files with 234 additions and 210 deletions

View File

@@ -110,7 +110,7 @@ wxCursor::wxCursor( int cursorId )
M_CURSORDATA->m_cursor = gdk_cursor_new( gdk_cur );
}
extern GtkWidget *wxRootWindow;
extern GtkWidget *wxGetRootWindow();
wxCursor::wxCursor(const char bits[], int width, int height,
int hotSpotX, int hotSpotY,
@@ -127,8 +127,8 @@ wxCursor::wxCursor(const char bits[], int width, int height,
if (hotSpotY < 0 || hotSpotY >= height)
hotSpotY = 0;
GdkBitmap *data = gdk_bitmap_create_from_data( wxRootWindow->window, (gchar *) bits, width, height );
GdkBitmap *mask = gdk_bitmap_create_from_data( wxRootWindow->window, (gchar *) maskBits, width, height);
GdkBitmap *data = gdk_bitmap_create_from_data( wxGetRootWindow()->window, (gchar *) bits, width, height );
GdkBitmap *mask = gdk_bitmap_create_from_data( wxGetRootWindow()->window, (gchar *) maskBits, width, height);
m_refData = new wxCursorRefData;
M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(