Re: expose_event



>I need to write an expose_event which clears a widget (GtkLayout) from
>things I've drawn on it.
>
>The way I do it at the moment is: gdk_draw_rectangle() (complete region)
>Unfortunately this also 'overwrites' too much (GtkFrames inside the
>GTkLayout disappear etc.)
>
>Any idea how to redraw without disturbing the other widgets ?

your question isn't quite clear to me. 

GtkLayout is a widget that allows you to position other widgets at
precise points (contrast with GtkTable or GtkBox). However, its not
written to support overlapping widgets. Furthermore, it would be odd
to use its expose_event to draw anything at all - the purpose of its
expose_event handler is simply to find its children within the expose
rect, and resynthesize an expose event for each of them.

Drawing on the GtkLayout's own window seems like an odd thing to do.

If you want to clear the GtkLayout, remove the widgets from it.

Perhaps you'd be better off explaining what you're trying to do. BTW,
I spent a year or two using a GtkLayout for the kind of thing you
sound as if you might be trying to do. When I eventually used the
Canvas, I realized I had made a serious error not starting out with
it.

--p



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