RoboFont observers ↩
Observers
from mojo.events import addObserver, removeObserver
addObserver(observer, method, event)
- Adds an observer for an event to the observer method.
removeObserver(observer, event)
- Removes the observer for an event.
Events
Any observer can subscribe to these events. The callback receives a dictionary with additional objects related to the sent event.
All notification dictionaries contain the following keys:
glyph
- the current/edited/active glyph
tool
- the current tool
view
- the current glyph view
acceptMenuEditCallbacks
Called by the glyph view when a menu item is validated. Should return a bool.
Extra notification keys: item
binaryFontWillOpen
Called when a new binary font will open event is posted.
Extra notification keys: font
, format
, source
currentGlyphChanged
Called when the current glyph changed event is posted.
Extra notification keys: sender
fontDidGenerate
Called when a font did generate a binary event is posted.
Extra notification keys: font
, format
, layerName
, path
fontWillGenerate
Called when a font will generate a binary event is posted.
Extra notification keys: font
, format
, layerName
, path
, testInstall
glyphWindowDidOpen
Called when a Glyph Window did open event is posted.
Extra notification keys: view
, window
glyphWindowWillClose
Called when a Glyph Window will close event is posted.
Extra notification keys: view
, window
glyphWindowWillOpen
Called when a Glyph Window will open event is posted.
Extra notification keys: view
, window
mouseDragged
Called when a mouse dragged event is posted.
Extra notification keys: delta
, event
, offset
, point
rightMouseDown
Called when a right mouse down event is posted.
Extra notification keys: event
, point
rightMouseDragged
Called when a right mouse dragged event is posted.
Extra notification keys: delta
, event
, offset
, point
spaceCenterDidOpen
Called when a Space Center did open event is posted.
Extra notification keys: font
, window
spaceCenterWillClose
Called when a Space Center will close event is posted.
Extra notification keys: font
, window
spaceCenterWillOpen
Called when a Space Center will open event is posted.
Extra notification keys: font
, window
transformChanged
Called when a transform matrix changed event is posted.
Extra notification keys: transformInfo
viewDidChangeGlyph
Called when a glyph view did change event is posted.
Extra notification keys: glyph
, view