Re: GtkTreeCellDataFunc



Bernd Demian wrote:
Hi all,
did anybody write his own GtkTreeCellDataFunc function or knows anybody
how to write it. I can't find any note.

Function to display text, when renderer is textrenderer, and column type is G_TYPE_POINTER:

static void
cell_function (GtkTreeViewColumn *tree_column,
	       GtkCellRenderer   *cell,
	       GtkTreeModel      *tree_model,
	       GtkTreeIter       *iter,
	       gpointer           data)
{
	gchar *name;
	
	gtk_tree_model_get (tree_model, iter, NAME_COLUMN, &name, -1);

	g_object_set (G_OBJECT (cell), "text", name, NULL);
}




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