GtkCellRendererText markup property issue
- From: Lance Zhang <zhangp8 hotmail com>
- To: <gtk-app-devel-list gnome org>
- Subject: GtkCellRendererText markup property issue
- Date: Sun, 6 Mar 2011 14:16:13 -0500
I have encountered this issue with gtk-2.20 & gtk-2.22.
I have a GtkTreeViewColumn with a GtkCellRendererText for which the "cell draw data func" has been set via
Then this is the critial part in the cell data func:
string no, name;
char buff; // for debug
gtk_tree_model_get((GtkTreeModel*)model, iter, 1, &id, -1);
sprintf(buff, "[ <b>%s</b> ] %s", no.c_str(), name.c_str());
// The Following 2 lines are critical
//g_object_set(cell, "text", buff, NULL); // line A
g_object_set(cell, "markup", buff, NULL); // line B
If line A is uncommented (and B is commented), it produces the correct (or expected) result, see attached
However, when line A is commented and B is uncommented (as shown above), the result will be wrong!
This "erratic" behavior is not consistent. For this record, it always shows wrong result, but for most all
other records, the results would be correct.
Anybody has any clues?
Thanks a lot!
] [Thread Prev