m_owner = (wxWindow *)NULL;
if (!window) return;
+
GtkWidget *widget = window->m_wxwindow;
if (!widget) return;
+
m_window = widget->window;
+
+ /* not realized ? */
+ if (!m_window)
+ {
+ /* force realization */
+ gtk_widget_realize( widget );
+ m_window = widget->window;
+ }
+
+ /* still not realized ? */
if (!m_window) return;
+
if (window->m_wxwindow)
m_cmap = gtk_widget_get_colormap( window->m_wxwindow );
else
{
/* we HAVE TO use the direct way for memory dcs
that have mask since the XCopyArea doesn't know
- about masks and */
+ about masks */
use_bitmap_method = TRUE;
}
else if (memDC->m_selected.GetDepth() == 1)
{
/* we HAVE TO use the direct way for memory dcs
- that are bitmaps because XCopyArea doesn't copy
+ that are bitmaps because XCopyArea doesn't cope
with different bit depths */
use_bitmap_method = TRUE;
}
long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
-
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
long wxWindowDC::GetCharWidth()
{
- wxCHECK_MSG( Ok(), 0, _T("invalid window dc") );
-
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
}
long wxWindowDC::GetCharHeight()
{
- wxCHECK_MSG( Ok(), 0, _T("invalid window dc") );
-
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
}
void wxWindowDC::SetFont( const wxFont &font )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
-
m_font = font;
}