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

Function PyCComboBox_insert_string

Pythonwin/win32control.cpp:964–982  ·  view source on GitHub ↗

@pymethod int|PyCComboBox|InsertString|Insert a string into a combobox.

Source from the content-addressed store, hash-verified

962
963// @pymethod int|PyCComboBox|InsertString|Insert a string into a combobox.
964static PyObject *
965PyCComboBox_insert_string(PyObject *self, PyObject *args)
966{
967 int pos;
968 PyObject *ob;
969 if (!PyArg_ParseTuple(args, "iO",
970 &pos, // @pyparm int|pos||The zero based index in the combobox to insert the new string
971 &ob)) // @pyparm any|object||The object to be added to the combobox
972 return NULL;
973 CComboBox *pLB = GetCombo(self);
974 if (!pLB)
975 return NULL;
976 CString cstrRepr = GetReprText(ob);
977 GUI_BGN_SAVE;
978 int rc = pLB->InsertString( pos, cstrRepr );
979 GUI_END_SAVE;
980 return Py_BuildValue("i", rc); // @pyseemfc CComboBox|InsertString
981 // @rdesc The zero based index of the new string added.
982}
983// @pymethod |PyCComboBox|ResetContent|Clear all the items from a combobox.
984static PyObject *
985PyCComboBox_reset_content(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 3

GetComboFunction · 0.85
GetReprTextFunction · 0.85
InsertStringMethod · 0.45

Tested by

no test coverage detected