mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
(listbox_get_length): new WListbox API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
2ed7abc3fe
commit
883e7b17b5
@ -639,10 +639,9 @@ void
|
||||
listbox_select_last (WListbox * l)
|
||||
{
|
||||
int lines = WIDGET (l)->lines;
|
||||
int length = 0;
|
||||
int length;
|
||||
|
||||
if (!listbox_is_empty (l))
|
||||
length = g_queue_get_length (l->list);
|
||||
length = listbox_get_length (l);
|
||||
|
||||
l->pos = length > 0 ? length - 1 : 0;
|
||||
l->top = length > lines ? length - lines : 0;
|
||||
@ -688,6 +687,14 @@ listbox_select_entry (WListbox * l, int dest)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
int
|
||||
listbox_get_length (const WListbox * l)
|
||||
{
|
||||
return listbox_is_empty (l) ? 0 : (int) g_queue_get_length (l->list);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* Returns the current string text as well as the associated extra data */
|
||||
void
|
||||
listbox_get_current (WListbox * l, char **string, void **extra)
|
||||
|
@ -68,6 +68,7 @@ int listbox_search_data (WListbox * l, const void *data);
|
||||
void listbox_select_first (WListbox * l);
|
||||
void listbox_select_last (WListbox * l);
|
||||
void listbox_select_entry (WListbox * l, int dest);
|
||||
int listbox_get_length (const WListbox * l);
|
||||
void listbox_get_current (WListbox * l, char **string, void **extra);
|
||||
WLEntry *listbox_get_nth_item (const WListbox * l, int pos);
|
||||
GList *listbox_get_first_link (const WListbox * l);
|
||||
|
Loading…
Reference in New Issue
Block a user