Re: GtkEditable and GtkTextView



On 18 Oct 2000, Havoc Pennington wrote:

> GtkTextBuffer is a text buffer. It has insert_text and delete_text
> signals, but with different signatures from GtkEditable (they use
> iterators instead of character offsets, among other things). These
> signals behave the same way as the GtkEditable signals, however, in
> that you can use them for filtering and the actual insertion or
> deletion occurs in the default handler. Multiple GtkTextView can
> display the same buffer.
> 
> There is no way we can think of to implement the
> insert_text/delete_text components of the GtkEditable interface in
> terms of GtkTextBuffer/GtkTextView, while preserving the semantics of
> the signals in both cases (when using GtkEditable, and when using the
> regular GtkTextBuffer interface).

Options -

  * Do nothing. Porting from Text to TextView/Buffer remains a hassle.

  * Remove the troublesome signals from the interface.  This will be only
    one of quite a few Editable changes... (How much code depends on being 
    able to attach insert_text and delete_text to a generic GtkText - 
    not much, I'll warrant)

  * When the signal is connected on the View, we hook up to the
    insert_text on the buffer, and then after converting iter->offset,
    call Editable::insert_text. (Does that even remotely make sense?)

-- 
I speak for myself, not my employer






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