Re: GtkGLArea and signals
- From: Sven Neumann <sven gimp org>
- To: layabouts the-giant-sofa demon co uk
- Cc: gtk-list gnome org
- Subject: Re: GtkGLArea and signals
- Date: 14 Mar 2002 11:43:49 +0100
Hi,
layabouts the-giant-sofa demon co uk writes:
> I've just started using GTK and GtkGLArea imparticular, and I've got a problem with signals...
>
> I have a callback that is responsible for redrawing the glarea widget when it receives an "expose_event" signal, which works fine when just resizing the
> window etc. But I also want a mouse motion callback to trigger a redraw of the widget, in much the same as you can use glutPostRedisplay() with GLUT. So I tried using gtk_signal_emit_by_name(GTK_OBJECT(gd.gl3dview), "expose_event", NULL)
> but this gives a segfault. When I looked at the example code for the lightwave object viewer it uses gtk_widget_draw() to accomplish the redraw.
>
> Why is it that I can't simply have the glarea widget signal itself that it is in need of a refresh? Isn't a widget allowed to signal itself?
if you would emit the signal correctly it would probably work
(you missed to pass a valid GdkEvent to signal_emit). However
the correct way of emitting an expose event is to use
gtk_widget_queue_draw() or gtk_widget_queue_draw_area().
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]