"Hibberd, Elisabeth" wrote:
> 
> Hi Chaplin,
> 
> here is the code for drawing the circle
> 
> /*------------DrawDrehscheibe-------------------------------------------
> ---------------------*/
> gint MaleDrehscheibe(gpointer data)
> {
>         GtkWidget* drawing_area = (GtkWidget *) data;
>         GdkDrawable *drawable;
>         GdkGC *gc;
>         GdkFont *font;
> 
>         GdkColor color = { 0xffff,0xffff,0xffff,0xffff};
>         drawable = drawing_area->window;
> 
>         gdk_gc_set_background(gc, &color) ;
>         gdk_draw_arc(drawable, gc, 1, 0, 0, 127, 127, 0, 360 *64);
> 
>         font =
> gdk_font_load("-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*");
>         gdk_draw_text (drawable, font, drawing_area->style->black_gc,
> 30, 70, "Drehscheibe",11);
>         return 1;
> }

You need to create the GdkGC, and also to allocate the GdkColor.

  GdkGC *gc;
  GdkColormap *colormap;
  GdkColor color = { 0xffff,0xffff,0xffff,0xffff};

  gc = gdk_gc_new (widget->window);
  colormap = gtk_widget_get_colormap (widget);
  if (!gdk_colormap_alloc_color (colormap, &color, FALSE, TRUE))
    g_warning ("Failed to allocate color");

You'd typically only want to do all this once, and the GdkGC can only
be created after the widget is realized.

Damon



+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.

Reply via email to