MCPcopy Index your code
hub / github.com/RustPython/RustPython / delete

Method delete

Lib/tkinter/__init__.py:3554–3568  ·  view source on GitHub ↗

Delete menu items between INDEX1 and INDEX2 (included).

(self, index1, index2=None)

Source from the content-addressed store, hash-verified

3552 self.insert(index, 'separator', cnf or kw)
3553
3554 def delete(self, index1, index2=None):
3555 """Delete menu items between INDEX1 and INDEX2 (included)."""
3556 if index2 is None:
3557 index2 = index1
3558
3559 num_index1, num_index2 = self.index(index1), self.index(index2)
3560 if (num_index1 is None) or (num_index2 is None):
3561 num_index1, num_index2 = 0, -1
3562
3563 for i in range(num_index1, num_index2 + 1):
3564 if 'command' in self.entryconfig(i):
3565 c = str(self.entrycget(i, 'command'))
3566 if c:
3567 self.deletecommand(c)
3568 self.tk.call(self._w, 'delete', index1, index2)
3569
3570 def entrycget(self, index, option):
3571 """Return the resource value of a menu item for OPTION at INDEX."""

Callers

nothing calls this directly

Calls 5

indexMethod · 0.95
entrycgetMethod · 0.95
strFunction · 0.85
deletecommandMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected