简体   繁体   中英

Highlight certain text in a PyGTK TextView

I have TextView with pages of text, but I want to be able to highlight (change the background color) of specific strings in different colors. Is this possible? If so, can anybody point me in the right direction? Thanks

有没有尝试过这个自己,但TextBuffer.insert_with_tags有正确地配置TextTag看起来很有希望。

如果特定的字符串始终与编程语言相同,那么请改用GtkSourceView

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM