summaryrefslogtreecommitdiffstats
path: root/FunctionBar.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-01-27 23:28:37 -0200
committerHisham Muhammad <hisham@gobolinux.org>2018-02-17 15:30:15 -0200
commit52b5beb4e47b635712d9832ffe524d17c730f7b8 (patch)
treefeae1d46425f262d1e4df752a26bd3548519d094 /FunctionBar.c
parentdf9922a67eb8e02ab4cf1ff8f24b40f14094e699 (diff)
Move responsibility for cursor placement to Panels
Diffstat (limited to 'FunctionBar.c')
-rw-r--r--FunctionBar.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/FunctionBar.c b/FunctionBar.c
index 4e4baaf3..630b1c83 100644
--- a/FunctionBar.c
+++ b/FunctionBar.c
@@ -96,11 +96,12 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) {
}
}
-void FunctionBar_draw(const FunctionBar* this, char* buffer) {
- FunctionBar_drawAttr(this, buffer, CRT_colors[FUNCTION_BAR]);
+int FunctionBar_draw(const FunctionBar* this, char* buffer) {
+ return FunctionBar_drawAttr(this, buffer, CRT_colors[FUNCTION_BAR]);
}
-void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) {
+int FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) {
+ int cursorX = 0;
attrset(CRT_colors[FUNCTION_BAR]);
mvhline(LINES-1, 0, ' ', COLS);
int x = 0;
@@ -115,12 +116,10 @@ void FunctionBar_drawAttr(const FunctionBar* this, char* buffer, int attr) {
if (buffer) {
attrset(attr);
mvaddstr(LINES-1, x, buffer);
- CRT_cursorX = x + strlen(buffer);
- curs_set(1);
- } else {
- curs_set(0);
+ cursorX = x + strlen(buffer);
}
attrset(CRT_colors[RESET_COLOR]);
+ return cursorX;
}
int FunctionBar_synthesizeEvent(const FunctionBar* this, int pos) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy