MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / set_active

Method set_active

site-packages/matplotlib/widgets.py:584–608  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Callers 2

_clickedMethod · 0.95
test_CheckButtonsFunction · 0.95

Calls 6

get_visibleMethod · 0.80
funcFunction · 0.50
set_visibleMethod · 0.45
drawMethod · 0.45
itemsMethod · 0.45
get_textMethod · 0.45

Tested by 1

test_CheckButtonsFunction · 0.76