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

Function PyCListBox_add_string

Pythonwin/win32control.cpp:290–308  ·  view source on GitHub ↗

@pymethod int|PyCListBox|AddString|Adds a string to a listbox.

Source from the content-addressed store, hash-verified

288}
289// @pymethod int|PyCListBox|AddString|Adds a string to a listbox.
290static PyObject *
291PyCListBox_add_string(PyObject *self, PyObject *args)
292{
293 CListBox *pLB = GetListBox(self);
294 if (!pLB)
295 return NULL;
296 PyObject *ob;
297 if (!PyArg_ParseTuple(args, "O", &ob )) // @pyparm any|object||Any object. If not a string, __str__, __repr__ or a default repr() will be used
298 return NULL;
299 CString cstrRepr = GetReprText(ob);
300 //@pyseemfc CListBox|AddString
301 GUI_BGN_SAVE;
302 int rc=pLB->AddString( cstrRepr );
303 GUI_END_SAVE;
304 if (IS_LB_ERR(rc))
305 RETURN_ERR("PyCListBox.AddString failed");
306 return Py_BuildValue("i", rc);
307 //@rdesc The zero based index of the new string.
308}
309// @pymethod int|PyCListBox|DeleteString|Deletes an item from a listbox.
310static PyObject *
311PyCListBox_delete_string(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 3

GetListBoxFunction · 0.85
GetReprTextFunction · 0.85
AddStringMethod · 0.80

Tested by

no test coverage detected