samuallb / ncurses Goto Github PK
View Code? Open in Web Editor NEWNcurses bindings for Crystal
Home Page: https://samuallb.github.io/ncurses/
License: MIT License
Ncurses bindings for Crystal
Home Page: https://samuallb.github.io/ncurses/
License: MIT License
Hello I'm new to crystal and NCurses so maybe maybe is something wrong with my code
use all 256 colors of the terminal or create a custom color like: Color::Lime = 10
I altered the file src/lib_ncurses.cr
adding the color i needed inside the color struct like this and it worked.
However if i try to do that inside the program it returns a compile error
enum LibNCurses::Color Lime = 10 end
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
Thank You in advance
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
For use with attr_*
functions
Is it possible to use scrollok
with these bindings?
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.
Where is clrtoeol
?
I tried
require "ncurses"
NCurses.start
NCurses.print "Hello world!"
puts "test"
NCurses.end
On a Mac , but it only prints "test"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.