summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d34028b)
raw | patch | inline | side by side (parent: d34028b)
author | Kalle Wallin <kaw@linux.se> | |
Sat, 27 Mar 2004 16:22:04 +0000 (16:22 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Sat, 27 Mar 2004 16:22:04 +0000 (16:22 +0000) |
list_window.c | patch | blob | history | |
list_window.h | patch | blob | history |
diff --git a/list_window.c b/list_window.c
index ab6c7d43b0cd9b44f02e4157057a1364c30573f2..fa1f949215fca34b5a9922b3616f96cef4765988 100644 (file)
--- a/list_window.c
+++ b/list_window.c
lw->clear = 1;
}
+void
+list_window_check_selected(list_window_t *lw, int length)
+{
+ if( lw->selected<0 )
+ lw->selected=0;
+
+ while( lw->selected>0 && length>0 && lw->selected>=length )
+ lw->selected--;
+}
+
void
list_window_set_selected(list_window_t *lw, int n)
{
diff --git a/list_window.h b/list_window.h
index ce799c1bdd6794a62fd985aa9675e3158f696dc6..c53f381a7f9771921444873f9dc9a144b3fbdae5 100644 (file)
--- a/list_window.h
+++ b/list_window.h
void list_window_last(list_window_t *lw, int length);
void list_window_previous_page(list_window_t *lw);
void list_window_next_page(list_window_t *lw, int length);
+void list_window_check_selected(list_window_t *lw, int length);
/* find a string in a list window */
int list_window_find(list_window_t *lw,