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");
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";
tag.Foreground = "black";
...
buffer.TagTable.Add (tag);
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
_______________________________________________ Gtk-sharp-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
