[GRASS5] column names GUI button

Markus Neteler neteler at itc.it
Tue May 17 12:06:54 EDT 2005


Hi,

usually I don't remember the column names of a vector map. For
this once we added '-c' to v.info to generate the list of column names,
such as

v.info -c roads
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|label

But it would be nice to have this as a button in the GUI.
So I have added three new functions to VECTLIB:

 char *Vect_get_column_names (struct Map_info *Map, int field);
 char *Vect_get_column_types (struct Map_info *Map, int field);
 char *Vect_get_column_names_types (struct Map_info *Map, int field);

which generate a comma separated list as (potential) input to a
GUI button, e.g. in display/d.vect/main.c 

  attrcol_opt->answers    = Vect_get_column_names (&Map, atoi (lfield_opt->answer));

Unfortunately, this code obviously crashes as we neither have Map nor lfield_opt
at this state of program execution (before G_parser()).

So these new functions are sort of useless (for this task). Anyway, there
are available now.

Markus




More information about the grass-dev mailing list