wxGUI.toolboxes(1grass)

πŸ’– wxGUI.toolboxes πŸ’–

okay bestie, buckle up β€” this is the wxGUI.toolboxes page from the GRASS User's Manual fr fr, and it's literally all about making the wxGUI menu do exactly what you want it to do. no cap. πŸ’…

🌸 KEYWORDS 🌸

general, GUI


✨ DESCRIPTION ✨

so basically, the Toolboxes thing is a way to customize the items in your wxGUI menu. like, you get to be the main character of your own menu bar. πŸŽ€ Toolboxes let you:

  • hide menu items you're not using, whether that's a whole menu (think Imagery, Database) or a submenu (think Wildfire modeling)
  • change the order of menu items and subitems, because sometimes the vibe is just different
  • add brand new menu items (hi Temporal πŸ‘‹)
  • add addons modules
  • add your own modules β€” yes, the ones you wrote, periodt

Toolboxes get configured through two XML files β€” main_menu.xml and toolboxes.xml β€” and they live in your user home GRASS directory, in a subdirectory called toolboxes ($HOME/.grass8/toolboxes/ on UNIX). πŸ¦‹

Currently, there is no GUI front-end for toolboxes, however only simple editing of text files is needed. ngl it's giving "just open the file and type", and honestly? that's iconic.

πŸ“ Brief description of file main_menu.xml

This file is the main menu itself (like File, Settings, Raster, ...). By modifying this file you show and hide menu items which are represented by subtoolbox tag. πŸ‘‘

Tag user-toolboxes-list is interpreted as a menu containing a list of all user-defined toolboxes. If not needed it can be removed. lowkey that's the whole sentence, highkey that's the whole feature. πŸ’

Following lines can be copied to .grass8/toolboxes/main_menu.xml and by removing, adding or reordering lines users can change the main menu items. See further examples.

<?xml version="1.0" encoding="UTF-8"?>
<toolbox name="MyMainMenu">
  <label>Default GRASS main menu bar</label>
  <items>
    <subtoolbox name="File"/>
    <subtoolbox name="Settings"/>
    <subtoolbox name="Raster"/>
    <subtoolbox name="Vector"/>
    <subtoolbox name="Imagery"/>
    <subtoolbox name="Volumes"/>
    <subtoolbox name="Database"/>
    <user-toolboxes-list />
    <subtoolbox name="Help"/>
  </items>
</toolbox>

πŸ¦‹ Brief description of file toolboxes.xml

This file contains the structure and description of the individual toolboxes. Note that both Raster and e.g. Query raster maps are individual toolboxes although one contains the other β€” yes bestie, toolboxes can be nested, it's giving family tree. 🌈 Tag toolbox contains subtoolbox tags which are defined later in the file. These nested toolboxes are linked through the name attribute.

Apart from the subtoolbox tag, tag toolbox can contain individual items (modules) and separators (for visual separation in the menu tree). ✨

<?xml version="1.0" encoding="UTF-8"?>
<toolboxes>
  <toolbox name="Raster">
    <label>&amp;Raster</label>
    <items>
      <subtoolbox name="DevelopRasterMap"/>
      <subtoolbox name="ManageRasterColors"/>
      <subtoolbox name="QueryRasterMaps"/>
      <subtoolbox name="RasterMapTypeConversions"/>
      <separator/>
      <module-item name="r.buffer">
        <label>Buffer rasters</label>
      </module-item>
      ...
      ...
  <toolbox name="QueryRasterMaps">
    <label>Query raster maps</label>
    <items>
      <module-item name="r.what">
        <label>Query values by coordinates</label>
      </module-item>
      <module-item name="r.what.color">
        <label>Query colors by value</label>
      </module-item>
    </items>
  </toolbox>

To redefine a toolbox (or use it as a template), copy specific part of file grass7/gui/wxpython/xml/toolboxes.xml from GRASS installation to a new file in user home (.grass8/toolboxes/toolboxes.xml) and edit it. Rename this new toolbox. πŸŽ€ (copy, rename, slay.)


πŸ”₯ EXAMPLES πŸ”₯

πŸ‘‘ Hiding menu items

If we are for example working only with raster data, we can hide menu items Vector and Database. The file main_menu.xml then contains the following lines where we omitted the two toolboxes:

<?xml version="1.0" encoding="UTF-8"?>
<toolbox name="CustomizedMainMenu">
  <label>Default GRASS main menu bar</label>
  <items>
    <subtoolbox name="File"/>
    <subtoolbox name="Settings"/>
    <subtoolbox name="Raster"/>
    <subtoolbox name="Imagery"/>
    <subtoolbox name="Volumes"/>
    <user-toolboxes-list />
    <subtoolbox name="Help"/>
  </items>
</toolbox>

πŸ’… Creating custom toolbox

In this example we create a new toolbox Favorites containing existing GRASS module and toolbox, custom module created by the user and addon module. The toolboxes.xml file contains following lines:

<?xml version="1.0" encoding="UTF-8"?>
<toolboxes>
  <toolbox name="MyFavorites">
    <label>&amp;Favorites</label>
    <items>
      <module-item name="g.region">
        <label>Set region</label>
      </module-item>
      <module-item name="r.mask">
        <label>Mask</label>
      </module-item>
      <separator/>
      <module-item name="m.myown">
        <label>Do my own stuff</label>
      </module-item>
      <module-item name="i.histo.match">
        <label>Calculate histogram matching</label>
      </module-item>
      <subtoolbox name="RasterReportsAndStatistics"/>
    </items>
  </toolbox>
</toolboxes>

Optionally, we can add this toolbox to the main menu items. The main_menu.xml file contains following lines:

<?xml version="1.0" encoding="UTF-8"?>
<toolbox name="CustomizedMainMenu">
  <label>Default GRASS main menu bar</label>
  <items>
    <subtoolbox name="File"/>
    <subtoolbox name="Settings"/>
    <subtoolbox name="Raster"/>
    <subtoolbox name="Vector"/>
    <subtoolbox name="Imagery"/>
    <subtoolbox name="Volumes"/>
    <subtoolbox name="Database"/>
    <user-toolboxes-list />
    <subtoolbox name="Favorites"/>
    <subtoolbox name="Help"/>
  </items>
</toolbox>

If we have user-toolboxes-list tag in the main_menu.xml file, our custom toolbox will be listed in the automatically added Toolboxes main menu item. The screenshot shows the resulting menu: πŸ“Έ


πŸ’€ NOTES πŸ’€

After the first start of wxGUI with custom toolboxes, .grass/toolboxes directory will contain file menudata.xml which is auto-generated and should not be edited. 🚫

bestie. do NOT touch menudata.xml. it's auto-generated. hands off. it will regenerate and you will simply be sad. 😭

🫢 SEE ALSO 🫢

  • wxGUI
  • wxGUI components

🌟 AUTHORS 🌟

  • Anna Petrasova, OSGeoREL, Faculty of Civil Engineering, Czech Technical University in Prague
  • Vaclav Petras, OSGeoREL, Faculty of Civil Engineering, Czech Technical University in Prague

⭐ SOURCE CODE ⭐

Available at: wxGUI Toolboxes source code (history)

Accessed: Friday May 08 10:38:23 2026

Main index | Wxgui index | Topics index | Keywords index | Graphical index | Full index


okay that's the whole page, no notes left behind, everything preserved fr fr πŸ’–βœ¨

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β€” and this lil guide ships with GRASS 8.5.0, last accessed Friday May 08 10:38:23 2026. go build ur dream menu bestie, u got this πŸŽ€πŸ’…πŸŒΈ

πŸ“¦ where this page comes from