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

Re: gEDA-user: Please test new grids for GTK PCB



Am 28.02.2011 11:48, schrieb jpka:
* the "Yes" is not updated also when grid changes via keypress while
>     preferences dialog is active
> > * maybe "Yes" as string column can be replaced with gboolean and a
>  GtkCellRendererToggle?
>     Or a custom renderer if really needed. Or a selection could be updated
>     on change of grid.
*Please help me with it.* GTK docs is not helpful for me (it's for guru?),
so only complete code examples i can use, but there is total lack of
useful
examples on internet.:(
Hello jpka!
I don't know how to fix the probem with updating the 'Yes'. But as a starting point I have changed the string 'Yes' to these radio-buttons. It is done by the following changes in src/gui-config.c: create_grid_treeview():

in the for-loop:
...
COL_GRIDSTEP, PCB->GridStep[i],
COL_GRIDCURRENT, (i == PCB->CurrentGrid) ? TRUE:FALSE,
-1);
...

Replace the last text-renderer (line 1478) by this code:
renderer = gtk_cell_renderer_toggle_new();
  gtk_cell_renderer_toggle_set_radio(renderer, true);
  gtk_cell_renderer_toggle_set_activatable(renderer, true);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Current?", renderer, "active", COL_GRIDCURRENT, NULL);

Hope, this code is helpful for you.
Kind regards!
Felix


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user