On Sep 18, 2007, at 11:31 PM, Michael Barton wrote:

Anyone who wants to have extensions (binary modules or scripts) that show up in the menu, would need to...

1) Put them in a directory and then make the directory visible to GRASS by adding it to GRASS_ADDON_PATH

Currently available.  It's the path(s) to extra bin folders.

3) In xtnmenu.dat, list the executable names of each extension (i.e., the name you would type on the command line to start it) with each name separated from the others by a <newline>. All you need is the name. This way the TclTk GUI OR wxPython GUI can build their respective menu entries as they need them.

How about 3 items per command - the menu name, help text (can be empty) and command.

4) A special name, called "separator", would also be allowed to mark places where the list of names is divided by a horizontal line from other names in the menu.

Submenus, if only one level, would be a good idea. If a user has a lot of extras installed, or just puts all their scripts in the menu, the menu could get very long.

At startup, the GUI would scan any directories stored in GRASS_ADDON_PATH searching for files named xtnmenu.dat. It would read each file and construct a menu entry from each item in the list of items in the file.

The menu files should probably NOT be in the same dir as the binaries themselves. That's what I set up the GRASS_ADDON_ETC for - it's where any programs that need extra data files look for them, including GRASS itself.

It would be easier to parse if everyone put the name of their extension(s) into the a SINGLE xtnmenu.dat file, shared by all (certainly my preference). But we should be able to deal with multiple xtnmenu.dat files, if need be, as long as they are all named xtnmenu.dat (or other standard) and all in a directory specified by GRASS_ADDON_PATH.

How about two default files:

- xtnmenu.dat for auto-generated menu items, either from GEM installer or something like my current startup method

- xtnmenu_user.dat for the user to maunally edit, without being trashed by the auto-generating methods.


When you think about it, ALL extensions (ie those installed by GEM and those by other methods) don't need to be in the same file (that could be trouble maintaining) - they just each use a different path in GRASS_ADDON_ETC.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian] What are you supposed to do WITH a maniacally depressed robot?

[Marvin] You think you have problems? What are you supposed to do if you ARE a maniacally depressed robot? No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy


_______________________________________________
grass-dev mailing list
[email protected]
http://grass.itc.it/mailman/listinfo/grass-dev

Reply via email to