如何使用gtkcssprovider为gtktextview中的字母添加颜色 [英] How to color letters in gtktextview with gtkcssprovider

查看:139
本文介绍了如何使用gtkcssprovider为gtktextview中的字母添加颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,



  .T {
颜色:蓝色;
}
.A {
颜色:红色;
}
等。

我目前有这个,

  GtkTextView {
color:blue
}

但它使所有textview都变成蓝色!
我不知道这是否可能,或者是否有另一种快捷方式来做到这一点。
做标签需要大量的文本处理能力。所以我正在寻找一个更快的替代方案,并且css看起来很有前途。



谢谢!

解决方案

你的建议是不可能的。我建议使用 GtkSourceView 并创建一个为您的信件添加特殊的语法高亮语言。 (当然,这将使用引擎盖下的标签,但是CSS也会在引擎盖下使用同样多的处理能力。)



其实我不知道知道是否可以用CSS自定义 GtkTextTag s本身;你可能想看看。


Hey i was wondering if it's possible to color specific letters in gtktextview with a css style sheet.

for example.

.T {
    color: blue;
}
.A {
   color: red;
}
etc..

i currently have this,

GtkTextView {
    color: blue
}

but it makes all the textview blue! i dont know if this is possible, or if there's another quick way to do this. Doing tags takes much processing power with a lot of text. so i'm looking for a faster alternative and css looks promising.

Thanks!

解决方案

What you suggest is not possible. I would suggest using GtkSourceView and creating a special syntax highlighting language for your letters. (This, of course, will use tags under the hood, but then again CSS would take just as much processing power under the hood too.)

I actually don't know if it's possible to style GtkTextTags themselves with CSS; you might want to look into that.

这篇关于如何使用gtkcssprovider为gtktextview中的字母添加颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆