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



Don't you get a SEGFAULT when this runs?  You have defined gc as a pointer to 
a graphics context but never allocated that graphics context or set gc to 
point to a known graphics context. I would suggest adding something like this:


static GdkGC *gc=NULL;  

. 
. 
. 
if(!gc)
{
 GdkColor color= {0xffff,0xffff,0xffff,0xffff};
 gc=gdk_gc_new(drawable);
 gdk_gc_set_background(gc, &color) ;
}       
 
The idea is to create a basically valid gc from your drawing area and modify
it.  Since this involve shipping things back and forth to the X-server do it
once and remember the pointer.

 
        

+---------------------------------------------------------------------+
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