Re: Text buffer API



on 7/10/00 2:41 PM, Derek Simkowiak at dereks@kd-dev.com wrote:

> -> For undo, we have a need to distinguish changes to text that happen as a
> -> result of a user action from those that are done by the code.
> 
> Can you elaborate on this?  I am also working on a text widget,
> and my "Undo" model has nothing to do with whether or not the text is
> entered by code or by fingers.  I would like to know why I should have a
> user_input signal in *my* widget...

In Nautilus, one place this came up was with the location entry in the
location bar. The location in the entry changes when the location changes.
It can also change in response to the user editing it. Our undo code that's
attached to the entry doesn't want to offer an "Undo Typing" command when
the "typing" is actually a location change. Thus we need to be able to
change the text without that being considered an undoable action.

In our original implementation we ignored this detail and were surprised to
see "Undo Typing" in the Edit menu after first starting up Nautilus. I'm
sure there are other kinds of solutions to this problem, some of which don't
require any additional signals in the widget.

> What about an X paste?  Is that considered user input or not?

That would be considered user input in this sense, yes.

    -- Darin





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