All pastes #82225 Raw Edit

Stuff

public text v1 · immutable
·published 2006-07-08 05:25 UTC
rendered paste body
	PyDoc_STRVAR(setImage__doc__,
		"setImage(filename) -- Changes the image.\n"
		"\n"
		"filename          : string or unicode - text string.\n"
		"\n"
		"example:\n"
		"  - self.image.setImage('q:\\scripts\\test.png')\n");

	PyObject* ControlImage_SetImage(ControlImage *self, PyObject *args)
	{
		PyObject *pObjectText;
	    string utf8filename;

		if (!PyArg_ParseTuple(args, "O", &pObjectText))	return NULL;
		if (!PyGetUnicodeString(self->strFileName, pObjectText, 1)) return NULL;
	
		ControlImage *pControl = (ControlImage*)self;
		CGUIMessage msg(GUI_MSG_LABEL_SET, pControl->iParentId, pControl->iControlId);
	
		PyGUILock();
		if (pControl->pGUIControl) 
			pControl->pGUIControl->Render();
			pControl->pGUIControl->OnMessage(msg);
		//pControl->pGUIControl->CGUIImage::SetFileName(self->strFileName);
		PyGUIUnlock();

		Py_INCREF(Py_None);
		return Py_None;
	}


	PyMethodDef ControlImage_methods[] = {
		{"setImage", (PyCFunction)ControlImage_SetImage, METH_VARARGS, setImage__doc__},
		{NULL, NULL, 0, NULL}
	};