[GRASS5] GUI code cleanup patch

Cedric Shock cedricgrass at shockfamily.net
Sun Mar 12 18:46:17 EST 2006


Hello,

This patch cleans up the calling convention between lib/gis/parser.c and 
lib/gis/gui.tcl. It extends general/g.parser/main.c to cover all of the 
string attributes available via the c interface. It adds a new char * 
guisection attribute to options and flags in include/gis.h.

In detail:

Flag and module attributes are now passed from lib/gis/parser.c to 
lib/gis/gui.tcl as the flattened list form of a tcl array, just like the 
attributes for options.

I moved GUI logic regarding text to use for labels (label or description) from 
lib/gis/parser.c to lib/gis/gui.tcl. This will allow a gui to decide, for 
example, to display the description text as "tooltip" or balloon help when an 
option has a label.

general/g.parser/main.c now parses all of the char* module, option, and flag 
attributes from the #% notation, including the new guisection attribute 
described below.

I added a new char* guisection attribute to struct Option and struct Flag. 
This is a string that arranges the options and flags into a tree hierarchy to 
allow for more organized user interfaces for commands with many options. This 
has not been implemented anywhere else yet. It contains the full tree path 
for where to place the option or flag, delimited by the ';' character. For 
programs with very options inputs this should remain null or be "". For 
example, an option for an input map might have just "Inputs" and an option 
for the learning rate for perceptrons in a neural network classification 
program might be "Neurons;Perceptrons". Examples of how this could be used in 
layout were discussed in the thread "GUI sections and metadata or history 
graphs."


These changes pave the way for work on more interesting or friendly generic 
user interfaces to the commands that make up the bulk of grass.

--Cedric Shock
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GUI_cleanup_patch_noOBJ
Type: text/x-diff
Size: 8236 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20060312/89e916a6/GUI_cleanup_patch_noOBJ.bin


More information about the grass-dev mailing list