Re: [gtk-list] Drawing Area Question





> I just started learning GTK+. Can somebody please tell me
> how to draw an image from a buffer into the drawing area.

  pixmap = gdk_pixmap_new(widget->window,
                          widget->allocation.width,
                          widget->allocation.height,
                          -1);
  gdk_draw_rectangle(pixmap,
                     widget->style->black_gc,
                     TRUE,
                     0,0,
                     widget->allocation.width,
                     widget->allocation.height);

You plot in the pixmap and than call gtk_widget_draw() to update.

	Sergei




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