#endif
#include "wx/gdicmn.h"
+#include "wx/app.h"
#include "wx/x11/private.h"
void wxColourRefData::FreeColour()
{
+#if 0
if (m_colormap)
{
Colormap cm = (Colormap)m_colormap;
-#if 0
GdkColormapPrivate *private_colormap = (GdkColormapPrivate*) m_colormap;
if ((private_colormap->visual->type == GDK_VISUAL_GRAYSCALE) ||
(private_colormap->visual->type == GDK_VISUAL_PSEUDO_COLOR))
if (colMapAllocCounter[ idx ] == 0)
gdk_colormap_free_colors( m_colormap, &m_color, 1 );
}
-#endif
}
+#endif
}
void wxColourRefData::AllocColour( WXColormap cmap )
else
{
m_refData = new wxColourRefData();
+
+ M_COLDATA->m_colormap = wxTheApp->GetMainColormap( wxGlobalDisplay() );
+
if (!XParseColor( wxGlobalDisplay(), (Colormap) M_COLDATA->m_colormap, colourName.mb_str(), &M_COLDATA->m_color ))
{
// VZ: asserts are good in general but this one is triggered by
void wxColour::CalcPixel( WXColormap cmap )
{
- if (!Ok()) return;
+ wxCHECK_RET( Ok(), wxT("invalid colour") );
+
+ wxCHECK_RET( cmap, wxT("invalid colormap") );
M_COLDATA->AllocColour( cmap );
}