MCPcopy Index your code
hub / github.com/python/cpython / delete

Method delete

Lib/tkinter/__init__.py:3632–3646  ·  view source on GitHub ↗

Delete menu items between INDEX1 and INDEX2 (included).

(self, index1, index2=None)

Source from the content-addressed store, hash-verified

3630 self.insert(index, 'separator', cnf or kw)
3631
3632 def delete(self, index1, index2=None):
3633 """Delete menu items between INDEX1 and INDEX2 (included)."""
3634 if index2 is None:
3635 index2 = index1
3636
3637 num_index1, num_index2 = self.index(index1), self.index(index2)
3638 if (num_index1 is None) or (num_index2 is None):
3639 num_index1, num_index2 = 0, -1
3640
3641 for i in range(num_index1, num_index2 + 1):
3642 if 'command' in self.entryconfig(i):
3643 c = str(self.entrycget(i, 'command'))
3644 if c:
3645 self.deletecommand(c)
3646 self.tk.call(self._w, 'delete', index1, index2)
3647
3648 def entrycget(self, index, option):
3649 """Return the value of OPTION for a menu item 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