Example #1
0
// @pymethod |PyCTreeCtrl|CreateWindow|Creates the actual window for the object.
static PyObject *
PyCTreeCtrl_CreateWindow(PyObject *self, PyObject *args)
{
	extern CWnd *GetWndPtrFromParam(PyObject *ob, ui_type_CObject &type);

	CTreeCtrl *pT = GetTreeCtrl(self, false);
	if (!pT) return NULL;
	RECT rect;
	PyObject *obParent;
	long style;
	long id;
	if(!PyArg_ParseTuple(args, "l(iiii)Ol:Create",
		&style, // @pyparm int|style||The window style
		&rect.left,  &rect.top,  &rect.right,&rect.bottom, // @pyparm int, int, int, int|rect||The default rectangle
		&obParent, // @pyparm parent|<o PyCWnd>||The parent window
		&id))// @pyparm int|id||The control ID
		return NULL;

	CWnd *pParent = NULL;
	if (obParent != Py_None) {
		pParent = GetWndPtrFromParam(obParent, PyCWnd::type);
		if (pParent==NULL) return NULL;
	}

	GUI_BGN_SAVE;
	// @pyseemfc CTreeCtrl|Create
	BOOL ok = pT->Create(style, rect, pParent, id);
	GUI_END_SAVE;
	if (!ok)
		RETURN_ERR("CTreeCtrl::Create failed");
	RETURN_NONE;
}