Re: gtk_widget_area - expose_event - problem



francex tiscali it wrote:

Hi,

I got from GDB this error for my application:

Program received signal SIGSEGV, Segmentation fault.
0x0804b349 in expose_event (widget=0x80ac738, event=0x0, g=0x0)
   at graph_edit.c:248
248       gdk_draw_drawable (widget->window,
(gdb)
<...>

static gint expose_event (GtkWidget *widget, GdkEventExpose *event, typGraphics
*g)
{
 /* --- Copy it right over. --- */
 gdk_draw_drawable (widget->window,
         widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
         g->pixmap,
         event->area.x, event->area.y,
         event->area.x, event->area.y,
         event->area.width, event->area.height);
 return FALSE;
}

Maybe problem is for 'typGraphics *g' in expose_Event(..) but for generic
'gpointer g' I have not solution...

Yes, it looks like that ('g' or 'g->pixmap' is/are probably the source of your problem). From the sample you've posted it's unclear how you allocate and fill a 'typGraphics' structures. You have to do this in "configure-event" callback.

   Olexiy




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