Discussion:
[GRASSGUI] Add addon menu files to Tcl GUI menu?
William Kyngesburye
2007-11-14 22:56:53 UTC
Permalink
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
2007-11-14 22:56:53 UTC
Permalink
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
Post by William Kyngesburye
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?
$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
William Kyngesburye
2007-11-14 22:56:53 UTC
Permalink
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.
Post by Michael Barton
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
Post by William Kyngesburye
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?
$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
2007-11-14 22:56:53 UTC
Permalink
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.
Post by William Kyngesburye
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

Loading...