klayout
klayout copied to clipboard
Python API: on_technology_changed event is not sent
This issue refers to this discussion: https://www.klayout.de/forum/discussion/2053/cellview-on-technology-changed-is-not-emitted#latest
A simple way to reproduce the problem is:
def ping():
print("Event caught (python)")
pya.CellView.active().on_technology_changed.add(ping)
When changing the technology on the cellview, the event is triggered, but "ping" is not called.
In Ruby, this feature works.
Looks like a workaround is to keep the event object:
# connect to signal from CellView
self._event = pya.CellView.active().on_technology_changed
self._event.add(self._check_technology_from_signal)
Seems like there is an acceptable workaround by keeping a reference to the CellView object.
def ping():
print("Event caught (python)")
cv = pya.CellView.active()
cv.on_technology_changed.add(ping)