[Gtk-sharp-list] TextView problem, how to insert text without tags

Gennadiy Donchyts don at env.com.ua
Wed Nov 16 16:18:03 EST 2005


I'm having small problems when inserting coloriyed text in TextView, I try
to show
text in the message window in the format: "<time>: <message>"
 <time> - blue foreground
<message> - black foreground
 the next code does not works as expected:

TextIter i = TextBuffer.GetIterAtOffset(0);
TextBuffer.InsertWithTagsByName(ref i, time, "blue_foreground");
TextBuffer.InsertWithTagsByName(ref i, , "normal");
TextBuffer.InsertWithTagsByName(ref i, String.Format(": {0}\n", message),
"normal");
 result:

01.01.2005: message 1 << second call (all line is blue)
01.01.2005: message 1 << first call (message - blue, text - black)
 tag "normal" is defined as:
 TextTag tag = new TextTag ("normal");
tag.Foreground = "black";
...
buffer.TagTable.Add (tag);
 I guess it is because I insert new text at position 0 which has
"blue_fireground" tag assigned,
but I also explicitly specify tag ....
 Thanks in advance,
-- Gena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20051116/542b9969/attachment.html


More information about the Gtk-sharp-list mailing list