MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / delete_widget

Function delete_widget

src_classic/utils.py:1690–1703  ·  view source on GitHub ↗

Delete widget from page and return the next one.

(page: Page, widget: Widget)

Source from the content-addressed store, hash-verified

1688
1689
1690def delete_widget(page: Page, widget: Widget) -> Widget:
1691 """Delete widget from page and return the next one."""
1692 CheckParent(page)
1693 annot = getattr(widget, "_annot", None)
1694 if annot is None:
1695 raise ValueError("bad type: widget")
1696 nextwidget = widget.next
1697 page.delete_annot(annot)
1698 widget._annot.__del__()
1699 widget._annot.parent = None
1700 keylist = list(widget.__dict__.keys())
1701 for key in keylist:
1702 del widget.__dict__[key]
1703 return nextwidget
1704
1705
1706def update_link(page: Page, lnk: dict) -> None:

Callers

nothing calls this directly

Calls 3

CheckParentFunction · 0.85
delete_annotMethod · 0.80
__del__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…