AC_INIT(newt_pr.h)
AC_CONFIG_HEADER(config.h)
-VERSION=$(awk '/^%define version/ {print $3}' newt.spec)
+VERSION=$(awk '/^%define version/ {print $3}' $srcdir/newt.spec)
-VERSION=0.50.34
+VERSION=0.50.35
SONAME=0.50
AC_SUBST(VERSION)
AC_SUBST(SONAME)
li->bdxAdjust = 0;
li->bdyAdjust = 0;
li->flags = flags & (NEWT_FLAG_RETURNEXIT | NEWT_FLAG_BORDER |
- NEWT_FLAG_MULTIPLE);
+ NEWT_FLAG_MULTIPLE | NEWT_FLAG_SHOWCURSOR);
if (li->flags & NEWT_FLAG_BORDER) {
li->bdxAdjust = 2;
SLsmg_write_nstring(item->text, li->curWidth);
}
- newtGotorc(co->top + (li->currItem - li->startShowItem), co->left);
+ newtGotorc(co->top + (li->currItem - li->startShowItem) + 1, co->left + 1);
}
static struct eventResult listboxEvent(newtComponent co, struct event ev) {
case EV_FOCUS:
li->isActive = 1;
listboxDraw(co);
+ if(li->flags & NEWT_FLAG_SHOWCURSOR)
+ newtCursorOn();
er.result = ER_SWALLOWED;
break;
case EV_UNFOCUS:
li->isActive = 0;
listboxDraw(co);
+ if(li->flags & NEWT_FLAG_SHOWCURSOR)
+ newtCursorOff();
er.result = ER_SWALLOWED;
break;
#define NEWT_FLAG_SELECTED (1 << 9)
#define NEWT_FLAG_CHECKBOX (1 << 10)
#define NEWT_FLAG_PASSWORD (1 << 11) /* draw '*' of chars in entrybox */
+#define NEWT_FLAG_SHOWCURSOR (1 << 12) /* Only applies to listbox for now */
#define NEWT_FD_READ (1 << 0)
#define NEWT_FD_WRITE (1 << 1)
#define NEWT_FD_EXCEPT (1 << 2)
self.item2key = {}
self.w.listboxClear()
- def __init__(self, height, scroll = 0, returnExit = 0, width = 0):
- self.w = _snack.listbox(height, scroll, returnExit)
+ def __init__(self, height, scroll = 0, returnExit = 0, width = 0, showCursor = 0):
+ self.w = _snack.listbox(height, scroll, returnExit, showCursor)
self.key2item = {}
self.item2key = {}
if (width):
static snackWidget * listboxWidget(PyObject * s, PyObject * args) {
snackWidget * widget;
int height;
- int doScroll = 0, returnExit = 0 ;
+ int doScroll = 0, returnExit = 0, showCursor = 0 ;
- if (!PyArg_ParseTuple(args, "i|ii", &height, &doScroll, &returnExit))
+ if (!PyArg_ParseTuple(args, "i|iii", &height, &doScroll, &returnExit, &showCursor))
return NULL;
widget = snackWidgetNew ();
widget->co = newtListbox(-1, -1, height,
- (doScroll ? NEWT_FLAG_SCROLL : 0) |
- (returnExit ? NEWT_FLAG_RETURNEXIT : 0));
+ (doScroll ? NEWT_FLAG_SCROLL : 0) |
+ (returnExit ? NEWT_FLAG_RETURNEXIT : 0) |
+ (showCursor ? NEWT_FLAG_SHOWCURSOR : 0)
+ );
widget->anint = 1;
return widget;
newtFormAddComponents(f, rsf, scale, NULL);
lb = newtListbox(45, 1, 6, NEWT_FLAG_MULTIPLE | NEWT_FLAG_BORDER |
- NEWT_FLAG_SCROLL);
+ NEWT_FLAG_SCROLL | NEWT_FLAG_SHOWCURSOR);
newtListboxAppendEntry(lb, "First", (void *) 1);
newtListboxAppendEntry(lb, "Second", (void *) 2);
newtListboxAppendEntry(lb, "Third", (void *) 3);