When the user hits enter or leaves the submission box, call this *func* with event. A connection id is returned which can be used to disconnect.
(self, func)
| 1741 | return self._observers.connect('change', lambda text: func(text)) |
| 1742 | |
| 1743 | def on_submit(self, func): |
| 1744 | """ |
| 1745 | When the user hits enter or leaves the submission box, call this |
| 1746 | *func* with event. |
| 1747 | |
| 1748 | A connection id is returned which can be used to disconnect. |
| 1749 | """ |
| 1750 | return self._observers.connect('submit', lambda text: func(text)) |
| 1751 | |
| 1752 | def disconnect(self, cid): |
| 1753 | """Remove the observer with connection id *cid*.""" |