clay icon indicating copy to clipboard operation
clay copied to clipboard

[Components] Text Edit component?

Open colesnicov opened this issue 1 year ago • 7 comments

Hello. Can draw Text input and Text edit (aka multiline) components? It is need also draw the cursor (blinked)

colesnicov avatar Dec 29 '24 21:12 colesnicov

Hello, sorry for the delay in getting to this. At the moment there isn't a built in editable text component - I have built a couple myself on top of clay so it's definitely possible, but does require a bit of work 🙂

nicbarker avatar Jan 02 '25 21:01 nicbarker

+1 for an editable text component.

anirudhs001 avatar Feb 02 '25 09:02 anirudhs001

Also +1 to have at least an example code of how it can be done.

guillaumechereau avatar Oct 13 '25 02:10 guillaumechereau

Any example code to impl Text Edit? maybe use clay+SDL?

IcyVizi avatar Oct 20 '25 05:10 IcyVizi

I think there will be nothing like that from the author. As I understand it, this is a UI framework for a kiosk, for example. Where the user is expected to only interact with the program by clicking on a menu item or a button (no text will be entered). You probably won't make a complete meaningful UI with this.

colesnicov avatar Oct 20 '25 06:10 colesnicov

There is no mention of keyboard and similar input devices in the README. But there is a lot about mouse and touch. Look in the Pull Requests, there are more than 60 of them, maybe you will find some hint there.

colesnicov avatar Oct 20 '25 06:10 colesnicov

As I understand it, this is a UI framework for a kiosk

@colesnicov, this isn't a UI framework. It's a layout library with a few extra features like hover detection and scrolling. That's why there is no mention of keyboard support anywhere, a layout library should never need to worry about it. Keyboard support is usually implemented by the renderer, so if I were using SDL2, I would handle keyboard inputs there and use a dynamic Clay_String to update a CLAY_TEXT element with the input.

gradylink avatar Nov 06 '25 03:11 gradylink