MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / delete

Method delete

tools/python-3.11.9-amd64/Lib/tkinter/__init__.py:3425–3439  ·  view source on GitHub ↗

Delete menu items between INDEX1 and INDEX2 (included).

(self, index1, index2=None)

Source from the content-addressed store, hash-verified

3423 self.insert(index, 'separator', cnf or kw)
3424
3425 def delete(self, index1, index2=None):
3426 """Delete menu items between INDEX1 and INDEX2 (included)."""
3427 if index2 is None:
3428 index2 = index1
3429
3430 num_index1, num_index2 = self.index(index1), self.index(index2)
3431 if (num_index1 is None) or (num_index2 is None):
3432 num_index1, num_index2 = 0, -1
3433
3434 for i in range(num_index1, num_index2 + 1):
3435 if 'command' in self.entryconfig(i):
3436 c = str(self.entrycget(i, 'command'))
3437 if c:
3438 self.deletecommand(c)
3439 self.tk.call(self._w, 'delete', index1, index2)
3440
3441 def entrycget(self, index, option):
3442 """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.80

Tested by

no test coverage detected