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

Function PyCComboBox_add_string

Pythonwin/win32control.cpp:904–922  ·  view source on GitHub ↗

@pymethod int|PyCComboBox|AddString|Adds a string to a combobox.

Source from the content-addressed store, hash-verified

902}
903// @pymethod int|PyCComboBox|AddString|Adds a string to a combobox.
904static PyObject *
905PyCComboBox_add_string(PyObject *self, PyObject *args)
906{
907 CComboBox *pCB = GetCombo(self);
908 if (!pCB)
909 return NULL;
910 PyObject *ob;
911 if (!PyArg_ParseTuple(args, "O", &ob )) // @pyparm any|object||Any object. If not a string, __str__, __repr__ or a default repr() will be used
912 return NULL;
913 CString cstrRepr = GetReprText(ob);
914 GUI_BGN_SAVE;
915 int rc=pCB->AddString( cstrRepr );
916 GUI_END_SAVE;
917 //@pyseemfc CComboBox|AddString
918 if (IS_CB_ERR(rc))
919 RETURN_ERR("PyCComboBox.AddString failed");
920 return Py_BuildValue("i", rc);
921 //@rdesc The zero based index of the new string.
922}
923// @pymethod int|PyCComboBox|DeleteString|Deletes an item from a combobox.
924static PyObject *
925PyCComboBox_delete_string(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 3

GetComboFunction · 0.85
GetReprTextFunction · 0.85
AddStringMethod · 0.80

Tested by

no test coverage detected