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-objects-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.

Variable: action-property-hook

Called when an action property is set. The arguments are the action, the property key and the property value. See Actions.

Since 1.10.

Variable: bind-keys-hook

Called when a key binding is set or modified. The arguments are the keymap, the key sequence and the binding’s target.

Note: bind-keys-hook may be run multiple times for a single key binding event if the target keymap is bound within a superior keymap.

Since 1.10.


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