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

Function PyCTreeCtrl_SetItemText

Pythonwin/win32ctrlTree.cpp:592–613  ·  view source on GitHub ↗

@pymethod int|PyCTreeCtrl|SetItemText|Changes the text of a list view item or subitem.

Source from the content-addressed store, hash-verified

590
591// @pymethod int|PyCTreeCtrl|SetItemText|Changes the text of a list view item or subitem.
592PyObject *PyCTreeCtrl_SetItemText( PyObject *self, PyObject *args )
593{
594 CTreeCtrl *pList = GetTreeCtrl(self);
595 if (!pList) return NULL;
596 HTREEITEM item;
597 TCHAR *text;
598 PyObject *obtext;
599 if (!PyArg_ParseTuple( args, "iO:SetItemText",
600 &item, // @pyparm HTREEITEM|item||The item whose text is to be retrieved.
601 &obtext)) // @pyparm string|text||String that contains the new item text.
602
603 return NULL;
604 if (!PyWinObject_AsTCHAR(obtext, &text, FALSE))
605 return NULL;
606 GUI_BGN_SAVE;
607 BOOL ok = pList->SetItemText(item, text);
608 GUI_END_SAVE;
609 PyWinObject_FreeTCHAR(text);
610 if (!ok)
611 RETURN_ERR("SetItemText failed");
612 RETURN_NONE;
613}
614
615// @pymethod object|PyCTreeCtrl|GetItemData|Retrieves the application-specific value associated with an item.
616PyObject *PyCTreeCtrl_GetItemData( PyObject *self, PyObject *args )

Callers

nothing calls this directly

Calls 1

GetTreeCtrlFunction · 0.85

Tested by

no test coverage detected