Next: 5. Image processing menus Up: 4. Reference Previous: 4.4.6 Making menu items Contents

#
4.5 The programming window

To pop up the programming window, click on `Toolkits` / `Edit Toolkits` in `nip2`'s main image processing window. The window shown in Figure 4.9 should appear.

Figure 4.9: Programming window

Each of the things down the left of the program window (the icon is supposed to look like a tool box) is a toolkit. Each toolkit is a text file containing a set of definitions in `nip2`'s programming language. See Chapter 6 for details on the language.

If you open a toolkit, `nip2` shows all of the definitions in that file (the icons are supposed to be spanners, I think). If you click on one of these `nip2` shows the source for that definition in the main part of the program window. After editing a definition, click on `File` / `Process text` to make `nip2` read what you typed, compile it, and update itself.

Click on `File` / `New` / `Tool` to add a new definition to a toolkit, click on `File` / `New` / `Toolkit` to make a completely new toolkit. You can also right-click on tools and toolkits to get a context menu, and you can left-drag tools to move them around within a toolkit or between toolkits.

Some toolkits are loaded from files when `nip2` starts up, others are built from the VIPS operation database (for example, `_arithmetic`), and one (called `_builtin`) contains the functions that are built into `nip2`. If you select a tool and then click on `Help` / `Documentation For This Tool`, `nip2` will try to display the relevant section from the VIPS manual in your web browser. Currently, this works only for things in the VIPS operation database: try `_arithmetic` / `im_add`, for example. There's a section in the `Preferences` workspace to control which web browser `nip2` uses and how it asks for a page.

Toolkits and tools whose names begin with an underscore character are not displayed in the main `Toolkits` menu. The idea is that they represent little utility functions, rather than stuff a user might be interested in. See §6.12.1 for more information on how tools and toolkits are displayed.

A final sort of tool has a floppy disc icon next to it. These tools represent scraps of workspace which are loaded when that menu item is selected, see §4.4.6. You can edit them by right-clicking and selecting the `Edit` item from the context menu.

You can have several programming windows open at the same time (often useful, if confusing). The `Edit` menu lets you search for patterns across all definitions. The `Jump to Definition of` item jumps to the definition of a symbol.

The `Debug` menu has items which open a trace window (use this to track the actions taken by `nip2`'s reduction engine) and which report on unresolved symbols and list all current errors.

Next: 5. Image processing menus Up: 4. Reference Previous: 4.4.6 Making menu items Contents