Re: Combining TreeView and DrawingArea (i.e. drawing on top of TreeView)



Hi Nickolai,

> As a quick elaboration on my previous question below, I am inheriting
>  from TreeView and try to add some drawing capabilities to it:
> 
> class TreeViewWithDrawings : public Gtk::TreeView /*, public 
> Gtk::DrawingArea*/ { protected: Glib::RefPtr<Gdk::GC> gc_; public: 
> virtual bool on_expose_event(GdkEventExpose* event); // Do the custom
>  drawing here. virtual void on_realize(); };

My understanding is that you can have only one on_expose_event function
that gets called for a window and you have to draw the complete window
from within that function. In overriding the on_expose_event for
TreeView, you are probably drawing to some unimportant background part,
while most of the actual drawing is done in child windows of the
TreeView. Deriving from DrawingArea doesn't help since that will not add
a second cumulative on_expose_event function (TreeView should already
have one of its own that gets overridden by your implementation). But
since you want to draw something around cells, maybe a custom
CellRenderer is what you need? (I have never tried this myself, though,
so I cannot help you with that.)

Cheers,

Jörn



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