diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2021-08-31 15:38:52 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2021-12-07 17:04:49 +1100 |
commit | 72ba20fa5f077bab4286dd78f9944df15de3b3b4 (patch) | |
tree | 0c4fb4e63b80b3a20d5f50bdac6bed9fe2bee607 /FunctionBar.c | |
parent | ff4f44b22ae8d6522ee22599174a6cdd41bc0314 (diff) |
Introduce screen tabs
This is a forward port (by nathans) of Hisham's original code.
Diffstat (limited to 'FunctionBar.c')
-rw-r--r-- | FunctionBar.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index fc3304ae..08500373 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -88,11 +88,12 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) { } } -void FunctionBar_draw(const FunctionBar* this) { - FunctionBar_drawExtra(this, NULL, -1, false); +int FunctionBar_draw(const FunctionBar* this) { + return FunctionBar_drawExtra(this, NULL, -1, false); } -void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor) { +int FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr, bool setCursor) { + int cursorX = 0; attrset(CRT_colors[FUNCTION_BAR]); mvhline(LINES - 1, 0, ' ', COLS); int x = 0; @@ -113,18 +114,20 @@ void FunctionBar_drawExtra(const FunctionBar* this, const char* buffer, int attr } mvaddstr(LINES - 1, x, buffer); x += strlen(buffer); + cursorX = x; } attrset(CRT_colors[RESET_COLOR]); if (setCursor) { - CRT_cursorX = x; curs_set(1); } else { curs_set(0); } currentLen = x; + + return cursorX; } void FunctionBar_append(const char* buffer, int attr) { |