X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/103aab266479b319424b86ebe67f8e125a0c3b73..fc4b32c270ed42e15421d2761fbf785134dd53fe:/src/gtk/bitmap.cpp diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index b85f97f63d..38d20c606c 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -243,15 +243,24 @@ wxBitmap::wxBitmap() wxBitmap::wxBitmap( int width, int height, int depth ) { - wxCHECK_RET( (width > 0) && (height > 0), wxT("invalid bitmap size") ) + Create( width, height, depth ); + + if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); +} + +bool wxBitmap::Create( int width, int height, int depth ) +{ + UnRef(); + + wxCHECK_MSG( (width > 0) && (height > 0), FALSE, wxT("invalid bitmap size") ) GdkVisual *visual = gdk_window_get_visual( wxRootWindow->window ); wxASSERT( visual ); if (depth == -1) depth = visual->depth; - wxCHECK_RET( (depth == visual->depth) || - (depth == 1), wxT("invalid bitmap depth") ) + wxCHECK_MSG( (depth == visual->depth) || + (depth == 1), FALSE, wxT("invalid bitmap depth") ) m_refData = new wxBitmapRefData(); M_BMPDATA->m_mask = (wxMask *) NULL; @@ -268,9 +277,8 @@ wxBitmap::wxBitmap( int width, int height, int depth ) M_BMPDATA->m_bpp = visual->depth; } - if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); + return Ok(); } - bool wxBitmap::CreateFromXpm( const char **bits ) { wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") )