-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More examples in documentation #92
Comments
Agreed, it could use some more examples and a walkthrough of how the components fit together. In the meantime, here's a link to how Harfbuzz' You could adapt it and add Kitty support by doing something similar for it as for sixels. Namely by adding something like this to the if-else ladder in there: if (chafa_term_info_have_seq (term_info, CHAFA_TERM_SEQ_BEGIN_KITTY_IMMEDIATE_IMAGE_V1))
{
pixel_mode = CHAFA_PIXEL_MODE_KITTY;
mode = CHAFA_CANVAS_MODE_TRUECOLOR;
} The call to I'll add API at some point to simplify creating a canvas configuration from a If there's anything else I can help with, feel free to ask here! |
I added an example recently that adapts to the environment. The approach from there (plus a little extra finesse) is being used by Cue, which is a pretty sweet app. Longer term, the goal is to convert this to a documentation section and add more convenience functions to the library that will cut down on the boilerplate. |
What I can't seem to figure out is how to combine these two examples: I want to use ncurses in the kitty terminal. adaptive.c works in kitty, and ncurses.c does 256 color in ncurses, but I can't get the best of both worlds. What am I missing? |
Unless I'm misunderstanding something, if you're trying to combine kitty or sixel graphics with ncurses, that's currently not possible except through bypassing the ncurses update mechanism. That would limit you in various ways and you'd have to issue the escape codes for the bypass manually. The issue is that ncurses doesn't understand any of the graphics protocols, so it won't play along. Ranger is a program using ncurses with the ability to bypass it - it lets you run an external program to print graphics into a predefined view. If you really want to do this, you could look at how it manages. |
In that case my original question is answered. Thanks so much for the help! |
No problem. Do you mind if I keep this issue open? We still need more examples in the actual documentation :-) |
Oh okay sure. Maintainers usually want the opposite so I did it by habit. |
I'm trying to learn how to use the C api. I've never worked with glib before and am having trouble figuring things out. I think some examples on top of the one in "Using Chafa in your Application" would be helpful. Specifically the kitty stuff is what I'm trying to use and that seems very different from that example.
The text was updated successfully, but these errors were encountered: