Re: reposition DrawingArea inside a Scrollbar after enlarging



Hi Hendrik,

On 8 July 2011 09:17, Hendrik Tews <tews os inf tu-dresden de> wrote:
> what is the preferred way to reposition a GtkDrawingArea inside a
> GtkScrollbar just after the GtkDrawingArea has been enlarged?

I agree, this can be tricky with an asynchronous toolkit.

In my opinion, the best solution is to do the scrolling from the
expose event. When you create the new object, set a flag on it called
scroll_on_expose or something like that. Then as you loop over your
objects in the expose handler, queue scroll requests if you see the
flag set (and then clear it, obviously).

I do this as a model-view thing in my app. My models emit "scrollto"
events when they are created, their associated views pick these
signals up and adjust their containing viewports to make sure that
they are visible.

John


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