Re: TreeViewColumn



r9u52 wrote:

Hi when I am using a TreeView to create a table I set the gtk_tree_view_column_set_alignment on each column and ths works fine to set the alignment of the text in the column header but I also need to set the alignment of the text in the rows of each column. Does anybody know of any easy way to do this.

Thanks
Charlie

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


You want to set the object property "alignment" when creating the column.
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeViewColumn.html#GtkTreeViewColumn--alignment

g_object_set(G_OBJECT(column), "alignment", (gfloat)0, NULL); /* LEFT */ g_object_set(G_OBJECT(column), "alignment", (gfloat)0.5, NULL); /* CENTER */ g_object_set(G_OBJECT(column), "alignment", (gfloat)1, NULL); /* RIGHT */

If you want to set the alignment of the cells instead, set the "xalign" property of the renderer:

   renderer = gtk_cell_renderer_toggle_new ();
   g_object_set (G_OBJECT(renderer), "xalign", 0.0, NULL);

Hope this helps
Martyn



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