Re: force configure-event



> Hi all,
>
> in my app I connect an "event" callback to a button. From within this
> callback I try to force a "configure-event" for a gtdrawingarea by calling
> gtk_widget_queue_draw(drawing_area). However, this signal is never
> emitted, therefore the drawingarea never gets redrawn.
>
> Any ideas why?

hi,

configure-event is called upon initial exposure of the drawing area and
changes in dimension (and probably more).  gtk_widget_queue_draw() will
invoke the expose-event callback you have defined for the drawing area.

one paradigm for managing this type of situation:

- in the configure event, call the routine responsible for making the drawing
- in the drawing routine, draw everything to a pixmap.  last line of code
is gtk_widget_queue_draw() on the drawing area the pixmap should be
rendered to.
- in the expose event, do nothing (in terms of drawing) except draw the
pixmap to the drawing area

following this allows you to call your drawing routines from within the
program itself, always resulting in a refresh of the drawing area.

ciao,

richard




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