Skip to content
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

Support an editable variant of TextGrid #2618

Open
drognisep opened this issue Nov 4, 2021 · 1 comment
Open

Support an editable variant of TextGrid #2618

drognisep opened this issue Nov 4, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@drognisep
Copy link
Contributor

Is your feature request related to a problem? Please describe:

I would really like to embed a code editor into a Fyne app. The closest match to the features expected of such a widget is the TextGrid, but it's read-only with no selection model.

Is it possible to construct a solution with the existing API?

Talking with @andydotxyz it seems like it could be possible with one of two approaches:

  1. Use the rich text support coming in 2.2-ish to support things like syntax highlighting, but (AFAIK) rich text doesn't support things like line numbers, tab width, addressable row/column, etc.
  2. Do the work of making an editable derivative like EditableTextGrid. It sounds like the initial approach would be copying a lot of code from Entry over to the derivative.

Describe the solution you'd like to see:

I think it's too much to ask for an IntelliJ code editor window, so here's a summary of features outside of just editing that would satisfy my use case or allow me to build additional features around it like working with feedback from a language server.

  • Line numbers
  • Different text styles within the widget (syntax highlighting)
  • Monospace font
  • Addressable row/column
  • Viewing whitespace if desired
  • Tab width

Personally, I think TextGrid is closer to what I would like to see than the rich text widget. However, it sounds like some thought would need to go into collecting text handling like input, selection, shortcuts, and mouse clicks into an abstraction over the widget handling those sorts of gestures.

I think that Entry is really great for its designed use, which is providing a consistent look and feel for general purpose text entry. With the creation of the rich text widget Fyne is graduating from general purpose I/O to purpose built widgets that provide a ton of value. I think that an editable TextGrid would add tremendous value to your users by allowing them to build the software that builds other things, and it could also be very useful in Defyne for giving people a familiar experience.

@andydotxyz andydotxyz added the enhancement New feature or request label Nov 8, 2021
@layxyer
Copy link

layxyer commented Feb 8, 2022

I also need this function, and the experience of similar functions is not very good now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants