kivy / kivy

Open source UI framework written in Python, running on Windows, Linux, macOS, Android and iOS
https://kivy.org
MIT License
17.63k stars 3.07k forks source link

Markup for TextInput, like Label #459

Closed rubik closed 11 years ago

rubik commented 12 years ago

Addition of markup tags ([color], [bold], &c.) to TextInput, like Label's ones.

akshayaurora commented 12 years ago

I believe what you are looking for is something that should be up-to the user to implement.

For example.. https://github.com/akshayaurora/CodeEd

This is a extremely rough code editor that uses pygments to highlight code. This uses markup to get it's desired output.

Hope this helps

rubik commented 12 years ago

I had precisely that in mind, only I did not know how to implement it. Thank you for your quick reply! I gave the code a cursory glance and it seems a bit hacky to implement. I'll read again the code in my own good time to understand how it work!

Thank you

AphonicChaos commented 12 years ago

I wonder if the innards of kivy.core.text.markup.MarkupLabel could be extracted into something like kivy.core.text.markup.MarkupEngine? That would allow it's logic to be reused for other widgets (or even custom widgets).

Better question might be if this is feasible or not. Again, I'm super tired, but I might look into this over my weekend (tues & wed)

rubik commented 12 years ago

+1 on that for me. I could be reused more easily.

akshayaurora commented 11 years ago

@rubik Does the new CodeInput Widget fulfill what was being asked for? If so let us know so, the issue can be closed

rubik commented 11 years ago

I haven't had the time to check that out and actually try it, but I guess it does. So this issue can be closed, leaving room for improvements on CodeInput Widget.

badjano commented 1 year ago

How do I make CodeInput work like a MarkupLabel? Is there any ready-to-use lexer for it? I just tried MarkdownLexer but it did not work as I thought it would

badjano commented 1 year ago

I just read this: https://pygments.org/docs/lexerdevelopment/ and it seems to me that this solution is very limited to certain tokens, we can't change the colors and we can't change the tokens in real time, so it is far from being a good alternative to a TextInput with MarkupLabel

badjano commented 1 year ago

@rubik please reopen

brvier commented 1 year ago

It s far better that Markup Label ...

You can implement your own token syntax You can implement your own style And all of this in realtime.