cairo pixmap draw_drawable problem



I'm trying to display a pixmap in a drawing area in gtkmm
and it's not working.  In gtk, I did something like this:

  pixmap_ = gdk_pixmap_new(darea_->window, width, height, -1);
  cr = gdk_cairo_create (pixmap_);
  // draw something here
  gdk_draw_drawable(darea_->window,
                    darea_->style->fg_gc[GTK_WIDGET_STATE (darea_)],
                    pixmap_,
                    0, 0, 0, 0, width, height);


In gtkmm, I'm doing something like this:
    pixmap_ = Gdk::Pixmap::create(window, width, height, -1);
    Cairo::RefPtr<Cairo::Context> cr = pixmap_->create_cairo_context();
    // draw something here
     pixmap_->draw_drawable(get_style()->get_fg_gc(Gtk::STATE_NORMAL),
                                           window, 0, 0, 0, 0, width, height);

What am I doing wrong?


Thanks,

             David



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