From b666ade78496cd91d648fcfe2fd6b79ce2b15e33 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Thu, 5 Feb 2009 05:45:40 +0000 Subject: [PATCH] use the right GdkWindow and origin for non-pizza widget with wxClientDC git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58675 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dcclient.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 8ae3e61149..93788ede5b 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -271,16 +271,16 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : GtkWidget *widget = window->m_wxwindow; // Some controls don't have m_wxwindow - like wxStaticBox, but the user - // code should still be able to create wxClientDCs for them, so we will - // use the parent window here then. + // code should still be able to create wxClientDCs for them if ( !widget ) { - window = window->GetParent(); - if (window) - widget = window->m_wxwindow; - } + widget = window->m_widget; + + wxCHECK_RET(widget, "DC needs a widget"); - wxASSERT_MSG( widget, wxT("DC needs a widget") ); + if (GTK_WIDGET_NO_WINDOW(widget)) + SetDeviceLocalOrigin(widget->allocation.x, widget->allocation.y); + } m_context = window->GtkGetPangoDefaultContext(); m_layout = pango_layout_new( m_context ); @@ -297,7 +297,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : return; } - m_cmap = gtk_widget_get_colormap( widget ? widget : window->m_widget ); + m_cmap = gtk_widget_get_colormap(widget); SetUpDC(); -- 2.45.2