From 303495ecd1a4cbe44557606a018a1c9820659a44 Mon Sep 17 00:00:00 2001 From: Mohammed Alyousef Date: Tue, 11 Jun 2024 16:50:27 +0300 Subject: [PATCH] allow browser deselect --- include/cfl_browser.h | 1 + src/cfl_browser.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/cfl_browser.h b/include/cfl_browser.h index 4cf2e6a..5b38afd 100644 --- a/include/cfl_browser.h +++ b/include/cfl_browser.h @@ -17,6 +17,7 @@ extern "C" { void widget##_clear(widget *); \ int widget##_size(const widget *); \ int widget##_select(widget *, int line); \ + int widget##_select_ext(widget *, int line, int val); \ int widget##_selected(const widget *, int line); \ const char *widget##_text(const widget *, int line); \ void widget##_set_text(widget *, int line, const char *newtext); \ diff --git a/src/cfl_browser.cpp b/src/cfl_browser.cpp index 8e4100e..f256bc0 100644 --- a/src/cfl_browser.cpp +++ b/src/cfl_browser.cpp @@ -47,6 +47,10 @@ LOCK(auto ret = self->select(line)); \ return ret; \ } \ + int widget##_select_ext(widget *self, int line, int val) { \ + LOCK(auto ret = self->select(line, val)); \ + return ret; \ + } \ int widget##_selected(const widget *self, int line) { \ LOCK(auto ret = self->selected(line)); \ return ret; \