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
Dear All:
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
gtk_tree_view_column_set_cell_data_func
Then this is the critial part in the cell data func:
int id;
string no, name;
char buff[1024]; // for debug
gtk_tree_model_get((GtkTreeModel*)model, iter, 1, &id, -1);
name=GetFullAccountName(id, &no);
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
file clip1.jpg.
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!
Lance
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]