Inserting a Gtk::StockID image in a treeview cell



Hello,

I'm wondering how i can put a Gtk::StockID image in a treeview cell ?

I curently know how to put a png file (as an example) but i don't know how to do the same thing with an icon such as Gtk::StockID(Gtk::Stock::YES) ...

Here is what I have :

    class ModelColumns : public Gtk::TreeModelColumnRecord
    {
    public:

        ModelColumns() {
            add(m_col_selected);
            add(m_col_name);
            add(m_col_state);
        }

        Gtk::TreeModelColumn<bool> m_col_selected;
        Gtk::TreeModelColumn<Glib::ustring> m_col_name;
        Gtk::TreeModelColumn < Glib::RefPtr < Gdk::Pixbuf > > m_col_state;
    };


.....

row[mColumns.m_col_state] = Gdk::Pixbuf::create("/usr/share/icons/Human/32x32/actions/media-eject.png");

--
Guillaume Radenne


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]