2004-08-13 Mike Kestner <mkestner@ximian.com>

* gtk/Gtk.metadata : hide Insert and SetText for manual impl.
	* gtk/TextBuffer.custom : pass -1 for length to Insert and SetText.
	Adapted from a patch by borsanza@yahoo.es (Borja Sanchez Zamorano).
	[Fixes #62985]

svn path=/trunk/gtk-sharp/; revision=32317
This commit is contained in:
Mike Kestner 2004-08-13 17:33:46 +00:00
parent 1d96ad49bc
commit d4e91dd83b
3 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2004-08-13 Mike Kestner <mkestner@ximian.com>
* gtk/Gtk.metadata : hide Insert and SetText for manual impl.
* gtk/TextBuffer.custom : pass -1 for length to Insert and SetText.
Adapted from a patch by borsanza@yahoo.es (Borja Sanchez Zamorano).
[Fixes #62985]
2004-08-04 Raja R Harinath <rharinath@novell.com>
* configure.in (GTKHTML): Use SOVERSION=11 for GtkHTML 3.1.18.

View File

@ -212,6 +212,8 @@
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetIterAtOffset']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetSelectionBounds']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='GetStartIter']/*/*[@type='GtkTextIter*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='Insert']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='SetText']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='MoveMarkByName']" name="name">MoveMark</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/method[@name='RemoveTagByName']" name="name">RemoveTag</attr>
<attr path="/api/namespace/object[@cname='GtkTextBuffer']/signal[@name='ApplyTag']" name="name">TagApplied</attr>

View File

@ -1,3 +1,8 @@
// TextBuffer.custom - customizations to Gtk.TextBuffer.
//
// Authors: Mike Kestner <mkestner@ximian.com>
//
// Copyright (c) 2004 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
@ -13,14 +18,16 @@
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
[DllImport("libgtk-win32-2.0-0.dll")]
static extern void gtk_text_buffer_set_text (IntPtr raw, string text, int len);
public string Text {
get {
return GetText (StartIter, EndIter, false);
}
set {
gtk_text_buffer_set_text (Handle, value,
System.Text.Encoding.UTF8.GetByteCount(value));
gtk_text_buffer_set_text (Handle, value, -1);
}
}
@ -32,11 +39,20 @@ public void Clear ()
// overload to paste clipboard contents at cursor editable by default.
[DllImport("libgtk-win32-2.0-0.dll")]
static extern void gtk_text_buffer_paste_clipboard (IntPtr raw, IntPtr clip, IntPtr iter, bool default_edit);
public void PasteClipboard (Gtk.Clipboard clipboard)
{
gtk_text_buffer_paste_clipboard(Handle, clipboard.Handle, IntPtr.Zero, true);
}
[DllImport("libgtk-win32-2.0-0.dll")]
static extern void gtk_text_buffer_insert (IntPtr raw, ref Gtk.TextIter iter, string text, int len);
public void Insert (Gtk.TextIter iter, string text)
{
gtk_text_buffer_insert (Handle, ref iter, text, -1);
}
public void InsertWithTags (TextIter iter, string text, params TextTag[] tags)
{
TextIter start;
@ -50,3 +66,8 @@ public void InsertWithTags (TextIter iter, string text, params TextTag[] tags)
this.ApplyTag (t, start, iter);
}
public void SetText (string text)
{
gtk_text_buffer_set_text (Handle, text, -1);
}