Re: GtkTreeView alignment

2003-11-19 Thread Manuel Op de Coul
Andrej wrote:
Example: out of the three, only the 1st one gets aligned when the row is
appended with e.g.:

Well according to the documentation the xalign property doesn't
exist for toggle- and pixbuf-renderers.
For pixbufs you could work around it by drawing them into other
ones with equal size.
For toggle buttons it would look strange to align them in the
middle if you ask me.

Manuel



___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkTreeView alignment

2003-11-18 Thread Andrej Prsa
Hi!

 See
 http://mail.gnome.org/archives/gtk-list/2003-October/thread.html

I am following this list closely and I was aware of your discussion about
aligning *text* cells. However, I was wondering if there is generic way to
align whatever contents of the cell, e.g. toggle-buttons and pixbufs.

Please see the example below!

Best wishes,

Andrej

--
Example: out of the three, only the 1st one gets aligned when the row is
appended with e.g.:

gtk_list_store_set (store, iter, 0, Undefined, 1, FALSE, 2, FALSE, 3,
syncolor, 4, expcolor, 5, 0.0, 6, TRUE, 7, 0.5, -1);


enum
  {
  PLOT_LC_FILTER,
  PLOT_LC_SYNTHETIC,
  PLOT_LC_EXPERIMENTAL,
  PLOT_LC_SYNCOLOR,
  PLOT_LC_EXPCOLOR,
  PLOT_LC_OFFSET,
  PLOT_LC_EDITABLE,
  PLOT_LC_ALIGNMENT,
  PLOT_LC_COLNO
  };

/* 1st example: */
renderer = gtk_cell_renderer_text_new ();
g_object_set_data (G_OBJECT (renderer), column, (gint *)
   PLOT_LC_FILTER);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_column_set_title (column, Filter);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_add_attribute (column, renderer, text, 0);
gtk_tree_view_column_add_attribute (column, renderer, xalign, 7);
gtk_tree_view_column_set_resizable (column, TRUE);
gtk_tree_view_column_set_min_width (column, 90);
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);

/* 2nd example: */
renderer = gtk_cell_renderer_toggle_new ();
g_object_set_data (G_OBJECT (renderer), column, (gint *)
PLOT_LC_SYNTHETIC);
g_signal_connect (G_OBJECT (renderer), toggled, G_CALLBACK
 (editable_cell_with_checkbox_edited), model);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_column_set_title (column, Synthetic data?);
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_add_attribute (column, renderer, active, 1);
gtk_tree_view_column_add_attribute (column, renderer, xalign, 7);
gtk_tree_view_column_set_resizable (column, TRUE);
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
g_object_set (G_OBJECT (column), alignment, 0.5, NULL);

/* 3rd example: */
renderer = gtk_cell_renderer_pixbuf_new ();
g_object_set_data (G_OBJECT (renderer), column, (gint *)
 PLOT_LC_SYNCOLOR);
g_object_set (G_OBJECT (renderer), mode,
 GTK_CELL_RENDERER_MODE_ACTIVATABLE, NULL);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_alignment (column, 0.5);
gtk_tree_view_column_set_title (column, Synthetic color);
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_add_attribute (column, renderer, pixbuf, 3);
gtk_tree_view_column_add_attribute (column, renderer, xalign, 7);
gtk_tree_view_column_set_resizable (column, TRUE);
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkTreeView alignment

2003-11-17 Thread Manuel Op de Coul

See
http://mail.gnome.org/archives/gtk-list/2003-October/thread.html

Manuel


___
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list