[GRASS-dev] Re: [GRASSGUI] Re: Add addon menu files to Tcl GUI menu?
William Kyngesburye
woklist at kyngchaos.com
Thu Sep 6 19:38:36 EDT 2007
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 at 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
More information about the grass-dev
mailing list