[Gtk-sharp-list] Re: [daemon@gigolo.li: [Mono-list] TextIter, TextBuffer issue]
Josef El-Rayes
j.el-rayes@daemon.li
Tue, 25 Feb 2003 20:21:53 +0100
Charles Iliya Krempeaux <charles@reptile.ca> 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.
for example:
--
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.
greets, josef
--
www: http://www.daemon.li
nic-hdl: JER1080312-NICAT
FreeBSD PortMaintainer
Student of ComputerScience