[GRASS-dev] Add addon menu files to Tcl GUI menu?

Something that got pushed back in my head, I'd like to get this in the 6.3 release. I have the OSX app startup generating tcl menu files (similar to GEM menu files) for the OSX addon folders. Can you get these into gmmenu.tcl?

OSX app addon menus are in:

$HOME/Library/GRASS/$GRASS_VER/Modules/etc/gm/addons

where $GRASS_VER is the major.minor version of the running GRASS. They are named with a .menu extension and are generated automatically on startup. I'm thinking there should also be a user-customizable menu that won't get zapped on every startup, maybe etc/gm/user.menu.

When you settle on a way to extend the python gui menu, I'll do a similar thing for that.

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

All generalizations are dangerous, even this one.

William,

I don't currently have a way to get these into gmmenu.tcl in such a way as
to have them show up on a Mac but not be a problem on other systems that
don't have this new feature. Do you have any suggestions along these lines?

Michael

On 9/4/07 8:48 AM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

Something that got pushed back in my head, I'd like to get this in
the 6.3 release. I have the OSX app startup generating tcl menu
files (similar to GEM menu files) for the OSX addon folders. Can you
get these into gmmenu.tcl?

OSX app addon menus are in:

$HOME/Library/GRASS/$GRASS_VER/Modules/etc/gm/addons

where $GRASS_VER is the major.minor version of the running GRASS.
They are named with a .menu extension and are generated automatically
on startup. I'm thinking there should also be a user-customizable
menu that won't get zapped on every startup, maybe etc/gm/user.menu.

When you settle on a way to extend the python gui menu, I'll do a
similar thing for that.

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

All generalizations are dangerous, even this one.

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From what I can understand of the logic in gmmenu.tcl, it tests for the GEM menu dir (etc/gm/Xtns), so it ignores it if it doesn't exist. Then it concats all .gem files there. The same method could be used for the OSX user folder, since it will not exist on other systems. Though if this user support setup is adopted by other systems it could be easily extended to them.

To make it system-agnostic, instead of hardwiring the OSX path (mainly the Library/ part, other systems could be .grass6/ on linux and whatever the user prefs or support folder is in a Windows user's home), it might try to use $GRASS_ADDON_ETC which would be set at startup per system (either init.sh or the initial grass script startup - currently the OSX startup sets this). This can have multiple paths separated by colons, like $PATH. Just check each path in $GRASS_ADDON_ETC for menu files in gm/addons.

I could probably duplicate that block and figure out how to handle a single hardwired path, but I'm not sure about splitting a string and adding a loop for the resulting pieces.

On Sep 6, 2007, at 6:02 PM, Michael Barton wrote:

William,

I don't currently have a way to get these into gmmenu.tcl in such a way as
to have them show up on a Mac but not be a problem on other systems that
don't have this new feature. Do you have any suggestions along these lines?

Michael

On 9/4/07 8:48 AM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

Something that got pushed back in my head, I'd like to get this in
the 6.3 release. I have the OSX app startup generating tcl menu
files (similar to GEM menu files) for the OSX addon folders. Can you
get these into gmmenu.tcl?

OSX app addon menus are in:

$HOME/Library/GRASS/$GRASS_VER/Modules/etc/gm/addons

where $GRASS_VER is the major.minor version of the running GRASS.
They are named with a .menu extension and are generated automatically
on startup. I'm thinking there should also be a user-customizable
menu that won't get zapped on every startup, maybe etc/gm/user.menu.

When you settle on a way to extend the python gui menu, I'll do a
similar thing for that.

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

All generalizations are dangerous, even this one.

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

"Mon Dieu! but they are all alike. Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings. And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

William Kyngesburye wrote:

Something that got pushed back in my head, I'd like to get this in
the 6.3 release. I have the OSX app startup generating tcl menu
files (similar to GEM menu files) for the OSX addon folders. Can you
get these into gmmenu.tcl?

Is it possible to share the Extensions menu with GEM? ie it's cleaner
to use a single hook into the menu system versus a number of duplicate
implementations.

Hamish

That pretty much what I'm thinking - adding it to the Xtns menu below any GEM stuff. And I'm using (I think) the same format in the menu files, so the same code could be used to construct the menus, with a little change.

On Sep 6, 2007, at 11:14 PM, Hamish wrote:

William Kyngesburye wrote:

Something that got pushed back in my head, I'd like to get this in
the 6.3 release. I have the OSX app startup generating tcl menu
files (similar to GEM menu files) for the OSX addon folders. Can you
get these into gmmenu.tcl?

Is it possible to share the Extensions menu with GEM? ie it's cleaner
to use a single hook into the menu system versus a number of duplicate
implementations.

Hamish

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

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war