From 69835a1cfec9c66f954ae61e64444fea9a82a02f Mon Sep 17 00:00:00 2001 From: ache Date: Thu, 24 Jan 2019 08:23:52 +0100 Subject: Set selected contact --- contactWind.c | 5 +++++ contactWind.h | 1 + contactWind.o | Bin 0 -> 7240 bytes 3 files changed, 6 insertions(+) create mode 100644 contactWind.o diff --git a/contactWind.c b/contactWind.c index 8a3f46c..fee0ffd 100644 --- a/contactWind.c +++ b/contactWind.c @@ -25,6 +25,11 @@ void selectNextContact(void) { if( contactListSelection < nbContacts - 1) contactListSelection++; } +void setContactSelection(contact* c) { + int i = c - contactList; + if( i >= 0 && i < nbContacts ) + contactListSelection = i; +} void selectPreviousContact(void) { if( contactListSelection > 0) contactListSelection--; diff --git a/contactWind.h b/contactWind.h index 41548b7..b7e1c53 100644 --- a/contactWind.h +++ b/contactWind.h @@ -13,6 +13,7 @@ void selectPreviousContact(void); struct contact* getContactSelected(void); +void setContactSelection(struct contact*); diff --git a/contactWind.o b/contactWind.o new file mode 100644 index 0000000..19c7256 Binary files /dev/null and b/contactWind.o differ -- cgit v1.2.3