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



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();
};

***

void TreeViewWithDrawings::on_realize()
{
  TreeView::on_realize();
  Glib::RefPtr<Gdk::Window> window = get_window();
  gc_ = Gdk::GC::create(window);
  window->clear();
}

bool TreeViewWithDrawings::on_expose_event(GdkEventExpose* event)
{
  TreeView::on_expose_event(event);
  get_window()->draw_line(gc_, 5, 11, 10, 11);
  return false;
}

The problem is that I only get the TreeView content rendered.  The draw_line call
has no effect AT ALL.  Anybody knows why this is being the case?

If not, is there any other way one could custom-draw on top of TextView?


Thanks,

Nickolai



On Thu, Jul 07, 2005 at 03:36:12PM -0500, Nickolai Dobrynin wrote:
> 
> I would like to use a TreeView-generated table and be able to do some
> customary drawing on top of it, the way it is done in DrawingArea.
> 
> If the two widgets are not combinable, then maybe there is a different
> way to draw a few straight lines on top of TreeView?  All I'm trying to do
> is put a frame around several cells in a table, all within the same row.
> 
> 
> Thanks very much,
> 
> Nickolai Dobrynin
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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