Selects an item by the text content of the child. Args: value (str): Text content of the item that have to be selected.
(self, value)
| 2691 | self.select_by_value(value) |
| 2692 | |
| 2693 | def select_by_value(self, value): |
| 2694 | """Selects an item by the text content of the child. |
| 2695 | |
| 2696 | Args: |
| 2697 | value (str): Text content of the item that have to be selected. |
| 2698 | """ |
| 2699 | self._selected_key = None |
| 2700 | self._selected_item = None |
| 2701 | for k in self.children: |
| 2702 | item = self.children[k] |
| 2703 | item.attributes['selected'] = False |
| 2704 | if value == item.get_value(): |
| 2705 | self._selected_key = k |
| 2706 | self._selected_item = item |
| 2707 | self._selected_item.attributes['selected'] = True |
| 2708 | |
| 2709 | |
| 2710 | class ListItem(Widget, _MixinTextualWidget): |
no test coverage detected