[Gtk-sharp-list] [Patch] gtk/TextBuffer.custom
Charles Iliya Krempeaux
charles@reptile.ca
25 Feb 2003 11:24:25 -0800
--=-yHQa8+R/ms5/Y6/1Ahhw
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Hello,
This is a Patch for: "gtk/TextBuffer.custom".
This Patch basically adds a new method to Gtk.TextBuffer. It makes
a method called: "ObtainIterAtOffset". It is used in the following
way:
Gtk.TextBuffer buffer;
// ...
int offset = 3;
Gtk.TextIter iter = buffer.ObtainIterAtOffset(offset);
The autogenerated way of doing this had the "Gtk.TextIter" returned
in a "out" parameter. (And had the method return nothing. I.e., had
the method return void.) It was done like:
Gtk.TextBuffer buffer;
// ...
int offset = 3;
buffer.ObtainIterAtOffset(out iter, offset);
Which isn't the way people would expect things to happen. (I.e.,
if you have a single thing to "return", then you return it... you
don't pass it back though an "out" parameter.)
(This Patch also contains a ChangeLog entry.)
See ya
--
Charles Iliya Krempeaux, BSc
charles@reptile.ca
________________________________________________________________________
Reptile Consulting & Services 604-REPTILE http://www.reptile.ca/
--=-yHQa8+R/ms5/Y6/1Ahhw
Content-Disposition: attachment; filename=gtk-sharp.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=gtk-sharp.diff; charset=ISO-8859-1
Index: ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/gtk-sharp/ChangeLog,v
retrieving revision 1.334
diff -u -r1.334 ChangeLog
--- ChangeLog 24 Feb 2003 08:04:41 -0000 1.334
+++ ChangeLog 25 Feb 2003 19:13:16 -0000
@@ -1,3 +1,9 @@
+2003-02-25 Charles Iliya Krempeaux <charles@reptile.ca>
+ * gtk/TextBuffer.custom : Added method, named
+ "ObtainIterAtOffset" to wrap C API procedure
+ "gtk_text_buffer_get_iter_at_offset" in a
+ more expected way.
+
2003-02-24 Mike Kestner <mkestner@speakeasy.net>
=20
* sample/TreeViewDemo.cs : fix Type ambiguities
Index: gtk/TextBuffer.custom
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /mono/gtk-sharp/gtk/TextBuffer.custom,v
retrieving revision 1.3
diff -u -r1.3 TextBuffer.custom
--- gtk/TextBuffer.custom 5 Jan 2003 23:48:45 -0000 1.3
+++ gtk/TextBuffer.custom 25 Feb 2003 19:13:19 -0000
@@ -12,3 +12,12 @@
{
Delete (StartIter, EndIter);
}
+
+public Gtk.TextIter ObtainIterAtOffset(int char_offset)
+{
+ Gtk.TextIter iter;
+
+ gtk_text_buffer_get_iter_at_offset(Handle, out iter, char_offset);
+
+ return iter;
+}
--=-yHQa8+R/ms5/Y6/1Ahhw--