Re: GtkRange API is incomplete



On Tue, 2010-07-27 at 17:15 +0200, Krzysztof Kosiński wrote:
> Hello
> 
> Here is my use use case (in Inkscape). I have a set of sliders
> (GtkScale) that control some values in the document. I want to update
> the view of the document in real time, but only push the change on the
> undo stack when the drag is finished. But the only signal I can
> connect to is value-changed. When I connect to it, I have only two
> choices:
> 1. Update policy GTK_UPDATE_DISCONTINUOUS. This will give me correct
> undo behavior but won't update the display in real time.
> 2. Update policy GTK_UPDATE_CONTINUOUS. This will update the display
> correctly but will flood the undo stack with partial changes.

You could implement undo compression as we do in GIMP. Multiple
consecutive position changes are compressed into a single undo step.
This can be easily implemented by looking at the top-most step on the
undo stack and checking if it is of the same type as the step you are
pushing.


Sven




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