git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58675
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
GtkWidget *widget = window->m_wxwindow;
// Some controls don't have m_wxwindow - like wxStaticBox, but the user
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
- 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 );
m_context = window->GtkGetPangoDefaultContext();
m_layout = pango_layout_new( m_context );
- m_cmap = gtk_widget_get_colormap( widget ? widget : window->m_widget );
+ m_cmap = gtk_widget_get_colormap(widget);