Git Product home page Git Product logo

ncurses's People

Contributors

bew avatar daviscodesbugs avatar maiha avatar mamantoha avatar maxpowa avatar mjago avatar rdeckard avatar samuallb avatar waterlink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ncurses's Issues

Use Custom Color in 256 color terminal

Hello I'm new to crystal and NCurses so maybe maybe is something wrong with my code

Objective

use all 256 colors of the terminal or create a custom color like: Color::Lime = 10

Demonstration

I altered the file src/lib_ncurses.cr adding the color i needed inside the color struct like this and it worked.
image

image

However if i try to do that inside the program it returns a compile error
enum LibNCurses::Color Lime = 10 end
image

Proposal

I would like to know how I can define new predefined color value or at least use raw Int32 values to the init_color_pair function, that only support statically defined LibNCurses::Color type and if It's not possible in the current state of the program make a few alterations and submit a pull request in your github

I'm still thinking the best approach but make the init_color_pair function support Int overloads sound the simplest solution to me. I tried and it seems to work but I don't know if it has security issues or affects the program in other unexpected way, so I would like to know your ideas about this problem

image

Thank You in advance

Verbatim "Hello world" example is not printing text

I've been trying to get the hello world example working. All dependencies are satisfied, the shard.yml file has been run. The file I have is "main.cr", and -aside from the text to print- is verbatim to the example provided. This is what it looks like:

require "ncurses"

NCurses.start
NCurses.print "Hi\n"
NCurses.end

When I run this the program compiles without warnings or error messages, but no text is printed. I tried this in both the integrated VS Code terminal and the OS terminal, the result is the same.

Was there a recent change in the ncurses binary or is it a problem on my side?

Current operating system: Linux Mint 19.2 Cinnamon.

Crystal version: Crystal 0.32.1
LLVM version: 8.0.0
Default target: x86_64-unknown-linux-gnu

Unicode input

It seems that the result of get_char does not agree with NCurses::print if they are multi-byte unicode codepoints in NCurses::Key. Key probably needs specific to_char and to_s implementations.

You can simply test this using the examples/input.cr and typing using a non-English input (Easiest would be Russian or Chinese I guess)

I tested on MacOS. Linux is probably the same.

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.