Next: , Previous: Selections, Up: gschem API Reference   [Contents][Index]


3.4 Hooks

To use the hooks described in this section, you will need to load the (gschem hook) module.

gschem defines a number of hooks that allow functions to be automatically run whenever a number of built-in actions are invoked by the user.

Most Scheme functions do not call these hooks. If it makes sense for your code to invoke a standard hook, you should normally do so explicitly.

Warning: Functions added to these standard hooks should not normally modify their arguments.

For more information on hooks in Guile, see Hooks in Guile Reference Manual.

Variable: add-object-hook

Called after objects are added to the page, at their initial creation. The argument is a list of the objects being added.

Variable: remove-objects-hook

Called after objects are removed from the page. Argument is a list of the objects being removed.

Variable: move-objects-hook

Called after objects are moved. Argument is a list of the objects that were mirrored.

Variable: mirror-objects-hook

Called after objects are mirrored. Argument is a list of the objects that were mirrored.

Variable: rotate-objects-hook

Called after objects are rotated. Argument is a list of the objects that were rotated.

Variable: paste-objects-hook

Called after objects are pasted to the page, either via Edit → Copy Mode or similar, or via buffers, or via the clipboard. Argument is a list of the objects that were pasted.

Variable: attach-attribs-hook

Called after attributes are attached to something. The argument is a list of the attributes that were attached.

Variable: detach-attribs-hook

Called after attributes are detached from something. The argument is a list of the attributes that were detached.

Variable: select-objects-hook

Called after objects are added to the selection. The argument is a list of objects that were selected.

Variable: deselect-objects-hook

Called after objects are removed from the selection. The argument is a list of objects that were deselected.

Variable: new-page-hook

Called when a new page is created. The argument is the new page.


Next: , Previous: Selections, Up: gschem API Reference   [Contents][Index]