1. PyObject * wndMgrSetSlotImage(PyObject * poSelf, PyObject * poArgs)
  2. {
  3. UI::CWindow * pWin;
  4. if (!PyTuple_GetWindow(poArgs, 0, &pWin))
  5. return Py_BuildException();
  6. int iSlotIndex;
  7. if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex))
  8. return Py_BuildException();
  9. char * szImagePath;
  10. if (!PyTuple_GetString(poArgs, 2, &szImagePath))
  11. return Py_BuildException();
  12. if (!pWin->IsType(UI::CSlotWindow::Type()))
  13. return Py_BuildException();
  14. UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin;
  15. CGraphicImage * pImage = (CGraphicImage *)CResourceManager::Instance().GetResourcePointer(szImagePath);
  16. if (!pImage)
  17. return Py_BuildException();
  18. pSlotWin->SetSlotLevelImage(iSlotIndex, pImage);
  19. return Py_BuildNone();
  20. }