[gnome-db] Proposal: gnome_db_tree_view_append_childs



/*This function appends childs, at the end of childs,
with the data 

* (just strings) contained in 'data_model' to the
level refered by 'iter' 

* (if NULL will be at the top level)

* return the number of rows appended to the treeview

*/

gint

gnome_db_tree_view_append_childs		(GtkTreeView *tree,

										 gint tree_ncols,

										 GtkTreeStore *store,

										 GtkTreeIter *top_iter,

										 GdaDataModel *data_model)

{

	GtkTreeIter child_iter;

	gint row, column;

	GString *text = g_string_new(NULL);

	

	if(GTK_IS_TREE_VIEW(tree))

	{

		for( row = 0;

			row < gda_data_model_get_n_rows(data_model);

			row++) 

		{

			gtk_tree_store_append(store,&child_iter,top_iter);

			

			for(column = 0;

				column < tree_ncols;

				column++)

			{

				text =
g_string_assign(text,gda_value_stringify(gda_data_model_get_value_at(data_model,

																		column,

																		row)));

				

				gtk_tree_store_set(store,&child_iter,

									column,

								
g_locale_to_utf8(text->str,-1,NULL,NULL,NULL),

									-1);				

			}

		}

		g_string_free(text,TRUE);

		return row;

	}

	g_string_free(text,TRUE);

	return 0;

}



=====
>>>>>>>>>>>>>>>
Trabajar es la mejor arma para tu superación.

_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx



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