MCPcopy Create free account
hub / github.com/mhammond/pywin32 / PyCListBox_insert_string

Function PyCListBox_insert_string

Pythonwin/win32control.cpp:354–374  ·  view source on GitHub ↗

@pymethod int|PyCListBox|InsertString|Insert a string into a listbox.

Source from the content-addressed store, hash-verified

352
353// @pymethod int|PyCListBox|InsertString|Insert a string into a listbox.
354static PyObject *
355PyCListBox_insert_string(PyObject *self, PyObject *args)
356{
357 int pos;
358 PyObject *ob;
359 if (!PyArg_ParseTuple(args, "iO",
360 &pos, // @pyparm int|pos||The zero based index in the listbox to insert the new string
361 &ob)) // @pyparm any|object||The object to be added to the listbox
362 return NULL;
363 CListBox *pLB = GetListBox(self);
364 if (!pLB)
365 return NULL;
366 CString cstrRepr = GetReprText(ob);
367 GUI_BGN_SAVE;
368 int rc=pLB->InsertString( pos, cstrRepr ); // @pyseemfc CListBox|InsertString
369 GUI_END_SAVE;
370 if (IS_LB_ERR(rc))
371 RETURN_ERR("PyCListBox.InsertString failed");
372 return Py_BuildValue("i", rc);
373 // @rdesc The zero based index of the new string added.
374}
375// @pymethod |PyCListBox|ResetContent|Clear all the items from a listbox.
376static PyObject *
377PyCListBox_reset_content(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 3

GetListBoxFunction · 0.85
GetReprTextFunction · 0.85
InsertStringMethod · 0.45

Tested by

no test coverage detected