signal help (loop)



I got a loop problem with signals... the problem is that
gtk_widget_queue_draw() emits an "expose_event". Can't i use
gtk_widget_queue_draw() in the "expose_event" handler ?

here's what i did, but it seems it doesn't prevent the function to
loop...
what am i doing wrong ?

void 
expose_event_handler (GtkWidget *zoneimage)
{
   gdk_draw_gray_image (zoneimage->window,
                       gdk_gc_new(zoneimage->window),
                       0,0, SIZE, SIZE,
                       GDK_RGB_DITHER_NORMAL,
                       image,
                       SIZE);

   gtk_signal_handler_block_by_func (GTK_OBJECT (zoneimage),
                                    GTK_SIGNAL_FUNC (expose_event_handler),
                                    NULL);
   gtk_widget_queue_draw (zoneimage);
   gtk_signal_handler_unblock_by_func (GTK_OBJECT (zoneimage),
                                      GTK_SIGNAL_FUNC (expose_event_handler),
                                      NULL);
   gtk_signal_emit_stop_by_name (GTK_OBJECT (zoneimage),
"expose_event");
}




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