fg_color and bg_color not set in gtk_text_iter_get_attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

I'm attempting to get the foreground and background color of text at an GtkTextIter using the gtk_text_get_attributes function, but it doesn't seem to set the appearance field. For example, the code below prints "#9393a1a1a1a1 #000000000000" (The default colors) when the text is rendered red. Note: Example code is in vala, but it's should be the same in C.

    Gtk.TextIter iter;
    buffer.get_iter_at_line(out iter, 0);
    iter.forward_to_tag_toggle(tag_table.lookup("red"));
    var attrs = text_view.get_default_attributes();
    iter.get_attributes(attrs);
    message("%s %s", attrs.appearance.fg_color.to_string(), attrs.appearance.bg_color.to_string());

Other properties such as weight and style are set correctly, it seems to be just the appearance field that is ignored. Any idea what is going on?

Thank you,
Timothy Johnson
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux