Hi! :-)

I have some question about GtkTreeView and GtkCellRenderer.
Is it possible to have different GtkAdjustment values for each
column(renderer?) in GtkTreeView?

I made a GtkTreeView with GtkTreeModel and put GtkCellRenderer
which is made by gtk_cell_renderer_spin_new() on that treeview's column.

Then I tried to set different values to each GtkAdjustment of spin button
by using gtk_cell_layout_set_cell_data_func (column, renderer,
cell_data_func, data, NULL);

But it didn't work properly.

I use cell_data_func like this:

static void
cell_data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
{
  ....
  if (...)
    {
      g_object_get (cell, "adjustment", &adj, NULL);

      /* apply */
      gtk_adjustment_set_lower (adj, video_attr.bitrate.min);
      gtk_adjustment_set_upper (adj, video_attr.bitrate.max);
      gtk_adjustment_set_step_increment (adj, video_attr.bitrate.step);
      gtk_adjustment_set_page_increment (adj, video_attr.bitrate.step * 2);
    }
  else if (...)
    {
      g_object_get (cell, "adjustment", &adj, NULL);

      /* apply */
      gtk_adjustment_set_lower (adj, video_attr.bitrate.min);
      gtk_adjustment_set_upper (adj, video_attr.bitrate.max);
      gtk_adjustment_set_step_increment (adj, video_attr.bitrate.step);
      gtk_adjustment_set_page_increment (adj, video_attr.bitrate.step * 2);
    }
    ....
}

Any help will be appreciated.
Thanks! :-)

-- 
Best regards,

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

Reply via email to