Directly (de)activate a check button by index. *index* is an index into the original label list that this object was constructed with. Raises ValueError if *index* is invalid. Callbacks will be triggered if :attr:`eventson` is True.
(self, index)
| 582 | break |
| 583 | |
| 584 | def set_active(self, index): |
| 585 | """ |
| 586 | Directly (de)activate a check button by index. |
| 587 | |
| 588 | *index* is an index into the original label list |
| 589 | that this object was constructed with. |
| 590 | Raises ValueError if *index* is invalid. |
| 591 | |
| 592 | Callbacks will be triggered if :attr:`eventson` is True. |
| 593 | |
| 594 | """ |
| 595 | if 0 > index >= len(self.labels): |
| 596 | raise ValueError("Invalid CheckButton index: %d" % index) |
| 597 | |
| 598 | l1, l2 = self.lines[index] |
| 599 | l1.set_visible(not l1.get_visible()) |
| 600 | l2.set_visible(not l2.get_visible()) |
| 601 | |
| 602 | if self.drawon: |
| 603 | self.ax.figure.canvas.draw() |
| 604 | |
| 605 | if not self.eventson: |
| 606 | return |
| 607 | for cid, func in self.observers.items(): |
| 608 | func(self.labels[index].get_text()) |
| 609 | |
| 610 | def get_status(self): |
| 611 | """ |