Exemple #1
0
// @pymethod int|PyCTreeCtrl|SetItem|Sets some of all of an items attributes.
PyObject *PyCTreeCtrl_SetItem( PyObject *self, PyObject *args )
{
	CTreeCtrl *pList;
	PyObject *obTVItem;
	if (!(pList=GetTreeCtrl(self)))
		return NULL;
	if (!PyArg_ParseTuple(args, "O:SetItem",
		                 &obTVItem)) // @pyparm <o TV_ITEM>|item||A tuple describing the new item.
		return NULL;
	TV_ITEM tvItem;
	if (!PyWinObject_AsTV_ITEM(obTVItem, &tvItem))
		return NULL;
 	GUI_BGN_SAVE;
	BOOL ok = pList->SetItem(&tvItem);
 	GUI_END_SAVE;
	PyWinObject_FreeTV_ITEM(&tvItem);
	if (!ok)
		RETURN_ERR("SetItem failed");
	RETURN_NONE;
}