Writing custom cell renderer



Hello!

Some time ago I wrote custom cell renderer using gtk+, now I'm trying to port/rewrite it to gtkmm and I'm not sure if I'm doing it right. I'm not sure about implementing new properties, here you have my code:

class TransferCellRenderer :
    public Gtk::CellRenderer
{
    public:
        TransferCellRenderer (void);
       
        void get_size_vfunc (Gtk::Widget &widget,
                             int         &x_offset,
                             int         &y_offset,
                             int         &width,
                             int         &height);

        void render_vfunc (const Glib::RefPtr <Gdk::Window> &window,
                           Gtk::Widget                      &widget,
                           const Gdk::Rectangle             &background_area,
                           const Gdk::Rectangle             &cell_area,
                           const Gdk::Rectangle             &expose_area,
                           Gtk::CellRendererState            flags);

    private:
        Glib::Property <TransferCellRendererObject *> property_transfer_object;
};

and constructor implementation:
TransferCellRenderer::TransferCellRenderer (void) :
    property_transfer_object (*this, "transfer-object")
{
    // ...
}

When I create new object, gtkmm displays message:

GLib-GObject-CRITICAL **: g_object_class_install_property: assertion `class->set_property != NULL' failed

What's wrong?

Additional question - There is nothing wrong with creating my renderer with: 'Gtk::manage (new TransferCellRenderer)' code?


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