my name 4 місяців тому
батько
коміт
3834d764c1
1 змінених файлів з 12 додано та 4 видалено
  1. 12 4
      cpp/ui/ncurses/hw/hwcurses.cpp

+ 12 - 4
cpp/ui/ncurses/hw/hwcurses.cpp

@@ -1,5 +1,6 @@
 #include <algorithm>
 #include <chrono>
+#include <clocale>
 #include <cstdio>
 #include <ctime>
 #include <functional>
@@ -61,13 +62,11 @@ public:
       }
     }
   }
-
-
 };
 
 void myupdatedisplay(const timer &timer_input) {
-  mvprintw(timer_input.triggercounter, timer_input.triggercounter, "hello %d",
-           timer_input.triggercounter);
+  int x_offset = COLS / 4;
+  mvprintw(timer_input.triggercounter, timer_input.triggercounter+x_offset, "test: █");
 }
 
 // manage collection of timers
@@ -93,9 +92,18 @@ public:
 };
 
 int main() {
+  setlocale(LC_ALL, "");
   initscr();
   nodelay(stdscr, FALSE);
   refresh();
+  start_color();
+  init_pair(1, COLOR_BLUE, COLOR_WHITE);
+  attron(COLOR_PAIR(1));
+  printw("Hello World! 🌍 テスト 测试");
+  const wchar_t wc = L'█';
+  cchar_t c_char;
+  setcchar(&c_char, &wc, A_NORMAL, 0, NULL);
+  mvwvline_set(stdscr, 1, 1, &c_char, 5);
   // printf("verification\n");
 
   auto starttime = std::chrono::steady_clock::now(); // initial starttime