gtk GtkTextView 使用尝试



GtkTextView:代表了窗口中可见的文本框,用来显示GtkTextBuffer.
GtkTextBuffer:文本框正文的缓冲区,文本框文字的插入、删除都是对这一类变量进行操作。
GtkTextIter:保存文字在buffer中位置的结构。
GtkTextMark:A position in the buffer preserved across buffer modifications
GtkTextTag:用来给指定的文字添加一些标记,改变指定区域的文字的显示效果。如:字体的颜色、大小的改变。
GtkTextTagTable:是GtkTextTag标记的集合表。

GtkTextIter — Text buffer iterator



  GtkWidget *view;
  GtkTextBuffer *buffer;
  GtkTextIter start, end;
  GtkTextIter iter;

  • GtkTextTag

所有可以设置的tag 属性参见https://developer.gnome.org/gtk3/stable/GtkTextTag.html

  "direction"                GtkTextDirection      : Read / Write
  "editable"                 gboolean              : Read / Write
  "editable-set"             gboolean              : Read / Write
  "family"                   gchar*                : Read / Write
  "family-set"               gboolean              : Read / Write
  "font"                     gchar*                : Read / Write
  "font-desc"                PangoFontDescription*  : Read / Write
  "foreground"               gchar*                : Write
  "foreground-gdk"           GdkColor*             : Read / Write
  "foreground-rgba"          GdkRGBA*              : Read / Write
  "foreground-set"           gboolean              : Read / Write
  "indent"                   gint                  : Read / Write
  "indent-set"               gboolean              : Read / Write
  "invisible"                gboolean              : Read / Write
  "invisible-set"            gboolean              : Read / Write
  "justification"            GtkJustification      : Read / Write

...................例子

	 GdkRGBA  rgba;
	 rgba.red=(gdouble)0xFF/(gdouble)255;/*FF69B4*/
	 rgba.green=(gdouble)0x14/(gdouble)255;/*DeepPink FF93*/
	 rgba.blue=
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值