Abstract base class for GUI neutral widgets
| 59 | |
| 60 | |
| 61 | class Widget(object): |
| 62 | """ |
| 63 | Abstract base class for GUI neutral widgets |
| 64 | """ |
| 65 | drawon = True |
| 66 | eventson = True |
| 67 | _active = True |
| 68 | |
| 69 | def set_active(self, active): |
| 70 | """Set whether the widget is active. |
| 71 | """ |
| 72 | self._active = active |
| 73 | |
| 74 | def get_active(self): |
| 75 | """Get whether the widget is active. |
| 76 | """ |
| 77 | return self._active |
| 78 | |
| 79 | # set_active is overridden by SelectorWidgets. |
| 80 | active = property(get_active, lambda self, active: self.set_active(active), |
| 81 | doc="Is the widget active?") |
| 82 | |
| 83 | def ignore(self, event): |
| 84 | """Return True if event should be ignored. |
| 85 | |
| 86 | This method (or a version of it) should be called at the beginning |
| 87 | of any event callback. |
| 88 | """ |
| 89 | return not self.active |
| 90 | |
| 91 | |
| 92 | class AxesWidget(Widget): |
nothing calls this directly
no test coverage detected