void AP_UnixLeftRuler::setView(AV_View * pView) { AP_LeftRuler::setView(pView); UT_ASSERT(gtk_widget_get_realized(m_wLeftRuler)); m_pG->setZoomPercentage(pView->getGraphics()->getZoomPercentage()); #if GTK_CHECK_VERSION(3,0,0) GtkWidget * w = gtk_label_new(""); ((GR_UnixCairoGraphics*)m_pG)->init3dColors(w); gtk_widget_destroy(w); #else GtkWidget * ruler = gtk_vruler_new (); ((GR_UnixCairoGraphics*)m_pG)->init3dColors(get_ensured_style(ruler)); #endif }
void AP_UnixLeftRuler::setView(AV_View * pView) { AP_LeftRuler::setView(pView); // We really should allocate m_pG in createWidget(), but // unfortunately, the actual window (m_wLeftRuler->window) // is not created until the frame's top-level window is // shown. DELETEP(m_pG); GR_UnixCairoAllocInfo ai(m_wLeftRuler->window); m_pG = XAP_App::getApp()->newGraphics(ai); UT_ASSERT(m_pG); m_pG->setZoomPercentage(pView->getGraphics()->getZoomPercentage()); GtkWidget * ruler = gtk_vruler_new (); ((GR_UnixCairoGraphics*)m_pG)->init3dColors(get_ensured_style (ruler)); }