(self)
| 577 | self.interface.content.refresh() |
| 578 | |
| 579 | def purge_toolbar(self): |
| 580 | while self._toolbar_items: |
| 581 | dead_items = [] |
| 582 | _, cmd = self._toolbar_items.popitem() |
| 583 | # The command might have toolbar representations on multiple window |
| 584 | # toolbars, and may have other representations (at the very least, a menu |
| 585 | # item). Only clean up the representation pointing at *this* window. Do this |
| 586 | # in 2 passes so that we're not modifying the set of native objects while |
| 587 | # iterating over it. |
| 588 | for item_native in cmd._impl.native: |
| 589 | if ( |
| 590 | isinstance(item_native, NSToolbarItem) |
| 591 | and item_native.target == self.native |
| 592 | ): |
| 593 | dead_items.append(item_native) |
| 594 | |
| 595 | for item_native in dead_items: |
| 596 | cmd._impl.native.remove(item_native) |
no test coverage detected