mail-archives/gtk-sharp-list/2004-February/003380.html

91 строка
2.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] TextBuffer InsertWithTags patch
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:sayao%40brturbo.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="Previous" HREF="003401.html">
<LINK REL="Next" HREF="003423.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] TextBuffer InsertWithTags patch
</H1>
<B>Thiago Milczarek Sayão
</B>
<A HREF="mailto:sayao%40brturbo.com"
TITLE="[Gtk-sharp-list] TextBuffer InsertWithTags patch">sayao@brturbo.com
</A><BR>
<I>Sun, 15 Feb 2004 14:31:59 -0300</I>
<P><UL>
<LI> Previous message: <A HREF="003401.html">[Gtk-sharp-list] Installation help again.
</A></li>
<LI> Next message: <A HREF="003423.html">[Gtk-sharp-list] TextBuffer InsertWithTags patch
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3380">[ date ]</a>
<a href="thread.html#3380">[ thread ]</a>
<a href="subject.html#3380">[ subject ]</a>
<a href="author.html#3380">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>--=-jetRiArqZZ4ZuGe4dX7X
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
This patch adds the function InsertWithTags to
TextBuffer.custom. It doesnt use the native gtk function.
--=-jetRiArqZZ4ZuGe4dX7X
Content-Disposition: attachment; filename=TextBuffer.diff
Content-Type: text/x-patch; name=TextBuffer.diff; charset=UTF-8
Content-Transfer-Encoding: 7bit
--- TextBuffer.custom.orig 2004-02-15 14:12:16.000000000 -0300
+++ TextBuffer.custom 2004-02-15 14:09:10.000000000 -0300
@@ -14,6 +14,19 @@
Delete (StartIter, EndIter);
}
+public void InsertWithTags (string text, params TextTag[] tags)
+{
+ TextIter iter;
+
+ this.Insert (EndIter, text);
+ iter = this.GetIterAtOffset (EndIter.Offset - text.Length);
+
+ foreach (TextTag t in tags)
+ {
+ this.ApplyTag (t, iter, EndIter);
+ }
+}
+
// overload to paste clipboard contents at cursor editable by default.
[DllImport(&quot;libgtk-win32-2.0-0.dll&quot;)]
static extern void gtk_text_buffer_paste_clipboard (IntPtr raw, IntPtr clip, IntPtr iter, bool default_edit);
--=-jetRiArqZZ4ZuGe4dX7X--
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="003401.html">[Gtk-sharp-list] Installation help again.
</A></li>
<LI> Next message: <A HREF="003423.html">[Gtk-sharp-list] TextBuffer InsertWithTags patch
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3380">[ date ]</a>
<a href="thread.html#3380">[ thread ]</a>
<a href="subject.html#3380">[ subject ]</a>
<a href="author.html#3380">[ author ]</a>
</LI>
</UL>
</body></html>