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

Method insert

Lib/tkinter/ttk.py:1331–1351  ·  view source on GitHub ↗

Creates a new item and return the item identifier of the newly created item. parent is the item ID of the parent item, or the empty string to create a new top-level item. index is an integer, or the value end, specifying where in the list of parent's children to inse

(self, parent, index, iid=None, **kw)

Source from the content-addressed store, hash-verified

1329
1330
1331 def insert(self, parent, index, iid=None, **kw):
1332 """Creates a new item and return the item identifier of the newly
1333 created item.
1334
1335 parent is the item ID of the parent item, or the empty string
1336 to create a new top-level item. index is an integer, or the value
1337 end, specifying where in the list of parent's children to insert
1338 the new item. If index is less than or equal to zero, the new node
1339 is inserted at the beginning, if index is greater than or equal to
1340 the current number of children, it is inserted at the end. If iid
1341 is specified, it is used as the item identifier, iid must not
1342 already exist in the tree. Otherwise, a new unique identifier
1343 is generated."""
1344 opts = _format_optdict(kw)
1345 if iid is not None:
1346 res = self.tk.call(self._w, "insert", parent, index,
1347 "-id", iid, *opts)
1348 else:
1349 res = self.tk.call(self._w, "insert", parent, index, *opts)
1350
1351 return res
1352
1353
1354 def item(self, item, option=None, **kw):

Callers

nothing calls this directly

Calls 2

_format_optdictFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected