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

Function PyCListCtrl_InsertColumn

Pythonwin/win32ctrlList.cpp:219–242  ·  view source on GitHub ↗

@pymethod int|PyCListCtrl|InsertColumn|Inserts a column into a list control when in report view.

Source from the content-addressed store, hash-verified

217
218// @pymethod int|PyCListCtrl|InsertColumn|Inserts a column into a list control when in report view.
219PyObject *PyCListCtrl_InsertColumn( PyObject *self, PyObject *args )
220{
221 CListCtrl *pList;
222 int iColNo;
223 PyObject *obLVCol;
224
225 if (!(pList=GetListCtrl(self)))
226 return NULL;
227
228 if (!PyArg_ParseTuple(args, "iO:InsertColumn",
229 &iColNo, // @pyparm int|colNo||The new column number
230 &obLVCol)) // @pyparm <o LV_COLUMN>|item||A tuple describing the new column.
231 return NULL;
232 LV_COLUMN lvCol;
233 if (!PyWinObject_AsLV_COLUMN(obLVCol, &lvCol))
234 return NULL;
235 GUI_BGN_SAVE;
236 int ret = pList->InsertColumn(iColNo, &lvCol);
237 GUI_END_SAVE;
238 PyWinObject_FreeLV_COLUMN(&lvCol);
239 if (ret==-1)
240 RETURN_ERR("InsertColumn failed");
241 return Py_BuildValue("i",ret);
242}
243
244// @pymethod int|PyCListCtrl|SetColumn|Changes column state in a list control when in report view.
245PyObject *PyCListCtrl_SetColumn( PyObject *self, PyObject *args )

Callers

nothing calls this directly

Calls 3

GetListCtrlFunction · 0.85
PyWinObject_AsLV_COLUMNFunction · 0.85

Tested by

no test coverage detected