Re: GtkEditable and GtkTextView

Tim Janik <timj gtk org> writes: 
> hm, could you elaborate a bit?
> i'm not sure i understand the problem and i have to admit at this point
> i'm not even sure anymore which of the things you're talking about is
> an object, an interface, an aggregate object.

GtkEditable is an interface. It has some methods and also three
signals: changed, insert_text, delete_text. The default handlers for
insert_text and delete_text are required to perform the actual
insertion or deletion, so that you can filter insertions or deletions
by connecting to the signal. e.g. if you have an entry and you only
want to allow numbers to be entered.

GtkTextView is a widget. It displays a GtkTextBuffer.

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).


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