-#ifdef __WXMOTIF__
- // Sorry, some Motif-specific code to implement a backing pixmap
- // for the wxRETAINED style. Implementing a backing store can't
- // be entirely generic because it relies on the wxWindowDC implementation
- // to duplicate X drawing calls for the backing pixmap.
-
- if ( m_targetWindow->GetWindowStyle() & wxRETAINED )
- {
- Display* dpy = XtDisplay((Widget)m_targetWindow->GetMainWidget());
-
- int totalPixelWidth = m_xScrollLines * m_xScrollPixelsPerLine;
- int totalPixelHeight = m_yScrollLines * m_yScrollPixelsPerLine;
- if (m_targetWindow->GetBackingPixmap() &&
- !((m_targetWindow->GetPixmapWidth() == totalPixelWidth) &&
- (m_targetWindow->GetPixmapHeight() == totalPixelHeight)))
- {
- XFreePixmap (dpy, (Pixmap) m_targetWindow->GetBackingPixmap());
- m_targetWindow->SetBackingPixmap((WXPixmap) 0);
- }
-
- if (!m_targetWindow->GetBackingPixmap() &&
- (noUnitsX != 0) && (noUnitsY != 0))
- {
- int depth = wxDisplayDepth();
- m_targetWindow->SetPixmapWidth(totalPixelWidth);
- m_targetWindow->SetPixmapHeight(totalPixelHeight);
- m_targetWindow->SetBackingPixmap((WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
- m_targetWindow->GetPixmapWidth(), m_targetWindow->GetPixmapHeight(), depth));
- }
-
- }
-#endif // Motif
-
- AdjustScrollbars();