static PyObject* py_scale_methods(PyObject *self, PyObject *args) { PyObject *newlist = NULL; VMDApp *app; int i, num; if (!(app = get_vmdapp())) return NULL; num = app->num_colorscale_methods(); if (!(newlist = PyList_New(num))) goto failure; for (i = 0; i < num; i++) { PyList_SET_ITEM(newlist, i, as_pystring(app->colorscale_method_name(i))); if (PyErr_Occurred()) goto failure; } return newlist; failure: PyErr_SetString(PyExc_RuntimeError, "Problem listing colorscales"); Py_XDECREF(newlist); return NULL; }
static PyObject *scale_method(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, (char *)"")) return NULL; VMDApp *app = get_vmdapp(); const char *method = app->colorscale_method_name(app->colorscale_method_current()); return PyString_FromString(method); }
static PyObject* py_scale_method(PyObject *self, PyObject *args) { VMDApp *app; const char *method; if (!(app = get_vmdapp())) return NULL; method = app->colorscale_method_name(app->colorscale_method_current()); return as_pystring(method); }
static PyObject *scale_methods(PyObject *self, PyObject *args) { if (!PyArg_ParseTuple(args, (char *)"")) return NULL; VMDApp *app = get_vmdapp(); int num = app->num_colorscale_methods(); PyObject *newlist = PyList_New(num); for (int i=0; i<num; i++) { PyList_SET_ITEM(newlist, i, PyString_FromString(app->colorscale_method_name(i)) ); } return newlist; }