depend:
$(CPP) $(CFLAGS) -M $(SOURCES) > .depend
-shareddir:
- mkdir -p shared
+$(SHAREDDIR):
+ mkdir -p $(SHAREDDIR)
-shared: $(LIBNEWTSH)
+sharedlib: $(LIBNEWTSH)
-$(LIBNEWTSH): shareddir $(SHAREDOBJS)
+$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
gcc -shared -o $(LIBNEWTSH) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS)
$(SHAREDDIR)/%.o : %.c
install -m 644 $(LIBNEWT) $(libdir)
install -s -m 755 whiptail $(bindir)
-install-sh: shared
+install-sh: sharedlib
install -m 755 $(LIBNEWTSH) $(libdir)
ln -sf $(LIBNEWTSH) $(libdir)/libnewt.so
/sbin/ldconfig
/* This goofed-up box whacked into shape by Elliot Lee <sopwith@cuc.edu>
(from the original listbox by Erik Troan <ewt@redhat.com>)
and contributed to newt for use under the LGPL license.
- Copyright Elliot Lee 1996 */
+ Copyright (C) 1996, 1997 Elliot Lee */
#include <slang/slang.h>
#include <stdio.h>
int newtListboxAddEntry(newtComponent co, char * text, void * data) {
struct listbox * li = co->data;
-#if 1
- newtListboxInsertEntry(co, text, data, li->numItems + 1);
-#else
struct items *item;
if(li->boxItems) {
listboxDraw(co);
return li->numItems;
-#endif
}
num = li->numItems;
if (li->boxItems) {
- if(num > 1) {
+ if(num > 0) {
for(i = 0, item = li->boxItems; item->next != NULL && i < num - 1;
item = item->next, i++);
t = item->next;