Git Product home page Git Product logo

Comments (12)

YuzukiTsuru avatar YuzukiTsuru commented on August 22, 2024

and ftxui::Menu can not select

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 22, 2024

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 22, 2024

Here is what I got:
https://asciinema.org/a/l0EAt5kwQLDkXEgUDDeJn5G5W

It seems to work as expected to me. Could you describe what do you think is a problem?

from ftxui.

YuzukiTsuru avatar YuzukiTsuru commented on August 22, 2024

I tested that all third-party terminals on Windows display normal, but only Windows CMD, PowerShell displays abnormal

PowerShell
image

Windows CMD
image

Windows Terminal CMD
image

Windows Terminal PowerShell
image

from ftxui.

YuzukiTsuru avatar YuzukiTsuru commented on August 22, 2024

Although Windows Terminal it can be displayed, the display screen is blinking

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 22, 2024

Thanks for the screenshot!

It looks like support for ANSI/VT100 codes on some windows terminal is not supported / disabled by default.
See this answer:
https://stackoverflow.com/a/51681675/5112390

I don't own a Windows desktop, but we just need to call SetConsoleMode. I already did that when using a ScreenInteractive:

SetConsoleMode(stdin_handle, in_mode);

I just need to add support for Screen. I will try today.

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 22, 2024

I took a Windows desktop, learn how to develop on it (it was unexpectedly hard), but I finally made it. I just uploaded a patch fixing most of your issues (on branch origin/dev)

I am also seeing a few more issues on windows. I will fix them soon.

from ftxui.

YuzukiTsuru avatar YuzukiTsuru commented on August 22, 2024

Thanks, it can be displayed now, but there is still a problem with the menu component. No way to select items.

D__GitHub_lr_cmake-build-release-visual-studio-any-cpu_A

the code is:

#include "ftxui/component/menu.hpp"
#include <chrono>
#include <iostream>
#include <thread>
#include "ftxui/component/screen_interactive.hpp"
int main(int argc, const char* argv[]) {
using namespace ftxui;
auto screen = ScreenInteractive::TerminalOutput();
Menu menu;
menu.entries = {L"entry 1", L"entry 2", L"entry 3"};
menu.selected = 0;
menu.on_enter = screen.ExitLoopClosure();
screen.Loop(&menu);
std::cout << "Selected element = " << menu.selected << std::endl;
}

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 22, 2024

I guess this is fixed right? I don't fully remember.

from ftxui.

iganinja avatar iganinja commented on August 22, 2024

I'm using tag 3.0.0 in Windows 8.1 CMD and it does not looks very well

image

This is the starter example/project

from ftxui.

ArthurSonzogni avatar ArthurSonzogni commented on August 22, 2024

Hello @iganinja,
Could you specify how you are building and linking FTXUI?

from ftxui.

iganinja avatar iganinja commented on August 22, 2024

Sure @ArthurSonzogni

This is the whole CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)

project(TMSE LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(TMSE main.cpp)

include(FetchContent)

FetchContent_Declare(ftxui
  GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
  GIT_TAG v3.0.0
)

FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
  FetchContent_Populate(ftxui)
  add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

target_link_libraries(TMSE
  PRIVATE ftxui::screen
  PRIVATE ftxui::dom
  PRIVATE ftxui::component
)

from ftxui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.