regarding treeview items
- From: sudheervegi <sudhirvegi gmail com>
- To: gtk-list gnome org
- Subject: regarding treeview items
- Date: Thu, 17 May 2007 03:18:22 -0700 (PDT)
iam using gtktreeview in my application .iam facing two problem
here is my code
store1 = gtk_tree_store_new (2, GDK_TYPE_PIXBUF,G_TYPE_STRING);
GtkTreeViewColumn *col;
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store1));
gtk_tree_view_set_rules_hint(treeview,TRUE);
col = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(col, "items");
renderer = gtk_cell_renderer_pixbuf_new();
gtk_tree_view_column_pack_start(col, renderer, FALSE);
gtk_tree_view_column_set_attributes(col, renderer,
"pixbuf", 0,
NULL);
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_column_pack_start(col, renderer,FALSE);
gtk_tree_view_column_set_attributes(col, renderer,
"text", 1,
NULL);
g_object_set(renderer,"weight","PANG0_WEIGHT_BOLD","weight-set",TRUE,NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col);
gtk_widget_show(treeeview);
void show_items()
{
GdkPixbuf *pixbuf;
GError *error = NULL;
pixbuf =
gdk_pixbuf_new_from_file("/usr/local/share/globe7/pixmaps/offline.bmp",
&error);
for (j=0;j<rec;j++) {
textNames[0] =item[j];
gtk_tree_store_append (store1, &iter,NULL);
gtk_tree_store_set (store1, &iter,0,pixbuf,
1,textNames[0],
-1);
}
gtk_widget_show_all(treeview);
}
iam calling this show_items () at startup of my application
my problems is
1)sometimes treeview items r not visible until we click on treeview,and
sometimes scrollbar also not showing
2)geting space before the pixbuf.i want add the item without space
thank u
--
View this message in context: http://www.nabble.com/regarding-treeview-items-tf3770912.html#a10661381
Sent from the Gtk+ - General mailing list archive at Nabble.com.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]