GtkStyle -> GtkTextTag procedure




Is there any good/documented way to take a GtkStyle and convert it to a GtkTextTag?

What I'm trying to do is allow set up of a standard gtkrc file, and be able to customize the font & color for different messages that my program will print in the GtkText.

I have working code that uses gtk_rc_get_style_by_paths() to get a GtkStyle that I want to use.

And while I can use style->fg, style->bg, style->font_desc to pull those values out of the style, the problem is that those are always filled in with values, even if not specified within the rc file (filled in with defaults).

This normally wouldn't be an issue, but it in many cases, I'll want to draw my text using multiple tags. So if I copy over the default font, then I lose my custom font (or if I give my directive for font priority, I may then loose my color).

I could limit this and say some tags can only specify font, others only specify color, etc, but I'd like to remain flexible. It may be that for certain messages, user will want to specify a certain font & color combination.

It seems what I really want to access is the GtkStyle->rc_style structure, which only has those fields set which are actually set in my rc file - I can then check for null values, or use the GtkRcFlags to see what colors may be set.

However, the rc_style is a private field within GtkStyle, and there are no functions within GtkStyle itself to return it.

There is gtk_widget_get_modifier_style(), but GtkStyle is derived from GObject, not from GtkWidget.

 Thoughts/ideas?






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