Logo Search packages:      
Sourcecode: agave version File versions  Download package

void gcs::Widgets::TextSwatch::on_realize ( void   )  [protected, virtual]

Initialize stuff when the object is realized. Before realization (i.e. in the constructor), we can't call get_window() or anything because the Gdk::Window doesn't yet exist

Reimplemented from gcs::Widgets::ColorSwatch.

Definition at line 103 of file gcs-textswatch.cc.

References gcs::Widgets::ColorSwatch::m_black, gcs::Widgets::ColorSwatch::m_borderGC, gcs::Widgets::ColorSwatch::m_borderWidth, gcs::Widgets::ColorSwatch::m_minSize, m_refContext, and m_textGC.

            // We need to call the base on_realize()

            // Now we can allocate any additional resources we need
            Glib::RefPtr<Gdk::Window> window = get_window();
            // set the size of the swatch.
            set_size_request(m_minSize, m_minSize);
            m_textGC = Gdk::GC::create(window);
            m_borderGC = Gdk::GC::create(window);
            m_borderGC->set_line_attributes(m_borderWidth, Gdk::LINE_SOLID,
                    Gdk::CAP_BUTT, Gdk::JOIN_MITER);
            add_events(Gdk::BUTTON_PRESS_MASK | Gdk::ENTER_NOTIFY_MASK |
            Glib::RefPtr<Pango::Context> m_refContext = create_pango_context();
            // create a pango layout for just the hex string
            m_pMinText.reset(new SwatchText(m_refContext, ""));
            // create a pango layout for the hex string, rgb, and hsv
            m_pMaxText.reset(new SwatchText(m_refContext, ""));
            pTooltips->set_tip(*this, _("Double-click to select"));

Generated by  Doxygen 1.6.0   Back to index