[Gtk-sharp-list] Re: [email@example.com: [Mono-list] TextIter, TextBuffer issue]
Tue, 25 Feb 2003 20:21:53 +0100
Charles Iliya Krempeaux <firstname.lastname@example.org> wrote:
> Note, I'm going to be creating a patch that will let you get a
> Gtk.TextIter with something like:
> iter = buff.ObtainIterAtOffset(offset);
> (This is probably how most people expect this to work.)
I am not really happy with this solution. it is not clean (in an
object-oriented kind of view) to have a class and using its constructor
breaks the object. i think it would be more straight forward to alter its
constructor that you supply it with the needed TextBuffer.
Gtk.TextBuffer buff = new Gtk.TextBuffer();
Gtk.TextIter iter = new Gtk.TextIter(buff.StartIter);
this should work as if you had done a "iter = buff.StartIter" but has the
advantage that it is preventing people from getting a broken iter by using
the standard constructor and is the it should be in an oop api.
object's instances should get created by using new.
Student of ComputerScience