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

Method delete_widget

src/__init__.py:10949–10961  ·  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

10947 return finished()
10948
10949 def delete_widget(page: 'Page', widget: Widget) -> Widget:
10950 """Delete widget from page and return the next one."""
10951 CheckParent(page)
10952 annot = getattr(widget, "_annot", None)
10953 if annot is None:
10954 raise ValueError("bad type: widget")
10955 nextwidget = widget.next
10956 page.delete_annot(annot)
10957 widget._annot.parent = None
10958 keylist = list(widget.__dict__.keys())
10959 for key in keylist:
10960 del widget.__dict__[key]
10961 return nextwidget
10962
10963 @property
10964 def derotation_matrix(self) -> Matrix:

Callers 1

test_3216Function · 0.80

Calls 2

CheckParentFunction · 0.85
delete_annotMethod · 0.80

Tested by 1

test_3216Function · 0.64