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

Function PyCTreeCtrl_GetItem

Pythonwin/win32ctrlTree.cpp:550–574  ·  view source on GitHub ↗

@pymethod |PyCTreeCtrl|GetItem|Retrieves the details of an items attributes.

Source from the content-addressed store, hash-verified

548
549// @pymethod <o TV_ITEM>|PyCTreeCtrl|GetItem|Retrieves the details of an items attributes.
550PyObject *PyCTreeCtrl_GetItem( PyObject *self, PyObject *args )
551{
552 HTREEITEM item;
553 UINT mask = TVIF_CHILDREN | TVIF_HANDLE | TVIF_IMAGE | TVIF_PARAM | TVIF_SELECTEDIMAGE | TVIF_STATE | TVIF_TEXT;
554
555 if (!PyArg_ParseTuple( args, "i|i:GetItem",
556 &item, // @pyparm HTREEITEM|item||The item whose attributes are to be retrieved.
557 &mask)) // @pyparm int|mask|(all flags set)|The requested attributes.
558 return NULL;
559
560 CTreeCtrl *pList = GetTreeCtrl(self);
561 if (!pList) return NULL;
562 TCHAR textBuf[256];
563 TV_ITEM tvItem;
564 tvItem.hItem = item;
565 tvItem.pszText = textBuf;
566 tvItem.cchTextMax = sizeof(textBuf)/sizeof(TCHAR);
567 tvItem.mask = mask;
568 GUI_BGN_SAVE;
569 BOOL ok = pList->GetItem( &tvItem);
570 GUI_END_SAVE;
571 if (!ok)
572 RETURN_ERR("GetItem failed");
573 return PyWinObject_FromTV_ITEM(&tvItem);
574}
575
576// @pymethod int|PyCTreeCtrl|GetItemText|Retrieves the text of a list view item or subitem.
577PyObject *PyCTreeCtrl_GetItemText( PyObject *self, PyObject *args )

Callers

nothing calls this directly

Calls 3

GetTreeCtrlFunction · 0.85
PyWinObject_FromTV_ITEMFunction · 0.85
GetItemMethod · 0.45

Tested by

no test coverage detected