[Gtk-sharp-list] Patch for Gtk.TextBuffer

Borja Sÿffffffffffe1nchez Zamorano borsanza@yahoo.es
Tue, 10 Aug 2004 18:54:32 +0200 (CEST)


Hello. I'm spanish and I have an error in
Gtk.TextView. Example:

	TextView view1 = new TextView();
	view1.Buffer.Insert(iter, "ñ");         // Error
	view1.Buffer.SetText("ñ");             // Error
	view1.Buffer.Text = "ñ";                // Correct

I propose this changes (use
System.Text.Encoding.UTF8.GetByteCount for Length):

Before:
                public void Insert(Gtk.TextIter iter,
string text) {
                        gtk_text_buffer_insert(Handle,
ref iter, text, text.Length);
                }

                public void SetText(string text) {
                       
gtk_text_buffer_set_text(Handle, text, text.Length);
                }

After:
                public void Insert(Gtk.TextIter iter,
string text) {
                        gtk_text_buffer_insert(Handle,
ref iter, text,
System.Text.Encoding.UTF8.GetByteCount(text));
                }

                public void SetText(string text) {
                       
gtk_text_buffer_set_text(Handle, text,
System.Text.Encoding.UTF8.GetByteCount(text));
                }

Thanks:

	BorSanZa


		
______________________________________________
Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es