[GRASS-dev] opt->guisection and opt->label for a better GUI world

Hamish hamish_nospam at yahoo.com
Fri Nov 17 02:27:56 EST 2006


I have updated a few complicated modules to use opt->guisection for nicer
GUI menus using tabs.

 d.legend
 d.vect
 r.report
 r.watershed
 r.sunmask
 v.buffer
 v.label

already done by Cedric:
 r.in.wms
 g.region

to be done: 
 (see below)

Wierdness-
order of tabs:
 the tab containing the first flag determines which tab comes first.
 the default tab "Options" should always be first.

tcltk bug:
 guisections with a space in them cause a tcl error (quoting? list vs string?)
 e.g. r.watershed, r.sunmask (I've used underscores)


I also updated parser.c to use opt->label a little more. (if opt->label
is used, it becomes the option's description, and the opt->description
text becomes the tooltip.

Suggestion- opt->description is long established, don't mess with it.
 change opt->label to opt->tooltip and reverse its meaning.
 Tooltips are good.

Suggestion 2- move G_define_module(), G_define_flag(), G_define_option(),
 and G_define_standard_option() out of parser.c. It's a 2,500 line long
 monster.


back to guisection:
The hierarchical rule of thumb is if it has more than 12 subordinates,
split it into smaller groups. But it's not a hard rule, e.g. I think
r.in.xyz is ok in a single tab.


here are the modules with more than 12 options+flags. I have removed
the ones already mentioned above.

cd $GISBASE/docs/html/
# ($1 -2) is to ignore --q,--v

grep "<DT><b>" * | cut -f1 -d: | uniq -c | sort -n | \
  awk '{if($1 -2 > 12) print }' | sed -e 's/\.html$//'
 
     15 d.what.vect
     15 g.remove
     15 r.flow
     15 r.terraflow
     16 d.nviz
     16 d.text.new
     16 r.out.vtk
     16 r.ros
     16 r3.out.vtk
     16 v.transform
     17 d.text.freetype
     17 r.cost
     17 v.distance
     17 v.lrs.create
     18 r.topmodel
     19 r.in.bin
     19 r.le.patch
     19 r.slope.aspect
     20 r.stats
     20 r.walk
     20 v.in.ogr
     21 r.resamp.rst
     21 r.spread
     21 v.in.ascii
     21 v.lrs.label
     23 r.texture
     24 r.sim.sediment
     24 r.sun
     25 r.sim.water
     26 v.vol.rst
     28 d.vect.thematic
     30 v.surf.rst

maybe someone feels organizational.


Hamish




More information about the grass-dev mailing list