def current(self):
return self.key2item[self.w.listboxGetCurrent()]
- def setCurrent(self, index):
- self.w.listboxSetCurrent(index)
+ def setCurrent(self, item):
+ self.w.listboxSetCurrent(self.item2key[item])
def __init__(self, height, scroll = 0, returnExit = 0, width = 0):
self.w = _snack.listbox(height, scroll, returnExit)
self.screen.popWindow()
return result
+ def addHotKey(self, keyname):
+ self.form.addHotKey(keyname)
+
def create(self):
if not self.form_created:
self.place(1,1)
text = item
key = count
+ if (count == default):
+ default = key
+ elif (count == item):
+ default = key
+
l.append(text, key)
count = count + 1
if (!PyArg_ParseTuple(args, "i", &index))
return NULL;
- newtListboxSetCurrent(s->co, index);
+ newtListboxSetCurrentByKey(s->co, index);
Py_INCREF(Py_None);
return Py_None;