GtkCellRendererText use of 'markup' and 'attributes' property



Hi guys,

I need to know how flexible is the GtkCellRenderText object to provide high formatted text. I can see in the API documentation that some Pango attributes are allowed but I have a conflict with two of them:

1. markup: Matthias listed this property as 'use-markup' in his recent book and described it as "Pango formats text written into this property" which honestly I do not understand the description at all. The API has an even less descriptive sentence (at least for me). Does anyone can explain me what does this property do?

2. attributes: I really can understand this property, this is the code I am using:

   PangoAttrList       *pango_format;
   PangoAttribute    *attr;
attr = pango_attr_foreground_new(0, 0, 255); pango_format = pango_attr_list_new();
   pango_attr_list_insert(pango_format, attr);

   g_object_set(text_renderer,
                "mode", GTK_CELL_RENDERER_MODE_INERT,
                "markup", "<span style=\"italic\">Obli</span>",
                "attributes", pango_format,
                NULL);
/* create column views */
   num_column    = gtk_tree_view_column_new_with_attributes("Numeral",
                                                          text_renderer,
"text", INT_COLUMN,
                                                          NULL);

Hope someone can give an advice.

Thanks



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