diff options
author | Matt Wilson <msw@redhat.com> | 1999-09-01 18:28:53 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-09-01 18:28:53 +0000 |
commit | 46756d6fb8d2a7d0e698b8cc2fd2f37c2ebbf10f (patch) | |
tree | d84f7dda950618b40f03f14c23b474f9fe0fcfc4 /gnome-map | |
parent | ea03fdb007c27a16acfe798819e9143dfac9f237 (diff) | |
download | anaconda-46756d6fb8d2a7d0e698b8cc2fd2f37c2ebbf10f.tar.gz anaconda-46756d6fb8d2a7d0e698b8cc2fd2f37c2ebbf10f.tar.xz anaconda-46756d6fb8d2a7d0e698b8cc2fd2f37c2ebbf10f.zip |
setcurrent
Diffstat (limited to 'gnome-map')
-rw-r--r-- | gnome-map/timezonemapmodule.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/gnome-map/timezonemapmodule.c b/gnome-map/timezonemapmodule.c index 997e7b49d..716fcfafa 100644 --- a/gnome-map/timezonemapmodule.c +++ b/gnome-map/timezonemapmodule.c @@ -743,15 +743,18 @@ main (int argc, char **argv) #endif -static PyMethodDef tzObjectMethods[] = { - { NULL }, -}; - typedef struct tzObject_t { PyObject_HEAD; MapData * mapdata; } tzObject; +static PyObject * setcurrent (tzObject * o, PyObject * args); + +static PyMethodDef tzObjectMethods[] = { + { "setcurrent", (PyCFunction) setcurrent, METH_VARARGS, NULL }, + { NULL } +}; + /* typedef struct tzObject_t tzObject; */ static PyObject * tzGetAttr(tzObject * o, char * name); @@ -774,6 +777,27 @@ static PyTypeObject tzType = { 0, /* tp_as_mapping */ }; + +static PyObject * setcurrent (tzObject * o, PyObject * args) { + char * loc; + int index; + + if (!PyArg_ParseTuple(args, "s", &loc)) + return NULL; + + index = find_location (o->mapdata->Locations, loc); + + if (index == -1) + return NULL; + + set_selection (o->mapdata, index, TRUE); + + Py_INCREF(Py_None); + return Py_None; +} + + + static PyObject * tzGetAttr(tzObject * o, char * name) { if (!strncmp (name, "map", 3)) { return PyGtk_New((GtkObject *) o->mapdata->map->canvas); |