mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Added listbox_set_list() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
1d16fd3a88
commit
1695465594
14
src/widget.c
14
src/widget.c
@ -2146,6 +2146,18 @@ listbox_select_first (WListbox *l)
|
||||
l->pos = l->top = 0;
|
||||
}
|
||||
|
||||
void
|
||||
listbox_set_list (WListbox *l, GList *list)
|
||||
{
|
||||
listbox_remove_list (l);
|
||||
|
||||
if (l != NULL) {
|
||||
l->list = list;
|
||||
l->top = l->pos = 0;
|
||||
l->count = g_list_length (list);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
listbox_remove_list (WListbox *l)
|
||||
{
|
||||
@ -2153,7 +2165,7 @@ listbox_remove_list (WListbox *l)
|
||||
g_list_foreach (l->list, (GFunc) listbox_entry_free, NULL);
|
||||
g_list_free (l->list);
|
||||
l->list = NULL;
|
||||
l->pos = l->top = 0;
|
||||
l->count = l->pos = l->top = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -228,6 +228,7 @@ void listbox_select_entry (WListbox *l, int dest);
|
||||
void listbox_select_first (WListbox *l);
|
||||
void listbox_select_last (WListbox *l);
|
||||
void listbox_remove_current (WListbox *l);
|
||||
void listbox_set_list (WListbox *l, GList *list);
|
||||
void listbox_remove_list (WListbox *l);
|
||||
void listbox_get_current (WListbox *l, char **string, void **extra);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user