scribble example question



Hi all,

I am messing around with the scribble example program that comes in the
gtk tutorial to attempt to understand how the drawing area works. I
tried to replace the example's rectangular brush for a circular brush
but after doing so I get no image displayed. Can anyone give an idea on
what's wrong, I attached the code I replaced into the callback:

/* Draw a rectangle on the screen */
static void draw_brush( GtkWidget *widget,
                        gdouble    x,
                        gdouble    y)
{
  GdkRectangle update_rect;

  update_rect.x = x - 5;
  update_rect.y = y - 5;
  update_rect.width = 10;
  update_rect.height = 10;

  gdk_draw_arc (pixmap,
                widget->style->black_gc,
                TRUE, update_rect.x, update_rect.y,
                update_rect.width, update_rect.height,
                0,  360);

/*
  gdk_draw_rectangle (pixmap,
                      widget->style->black_gc,
                      TRUE,
                      update_rect.x, update_rect.y,
                      update_rect.width, update_rect.height);
*/
  gtk_widget_draw (widget, &update_rect);
}

--
Marco Quezada
Aerospaceo Engineero
NLX Corporation
22626 Sally Ride Dr.
Sterling, VA, 20164
mquezada nlxcorp com
703-234-2100 x1028
http://www.nlxcorp.com







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