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

Entry ReadOnly #5534

Closed
2 tasks done
nagylzs opened this issue Feb 15, 2025 · 5 comments
Closed
2 tasks done

Entry ReadOnly #5534

nagylzs opened this issue Feb 15, 2025 · 5 comments

Comments

@nagylzs
Copy link

nagylzs commented Feb 15, 2025

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

It is possible to disable an Entry, but that prevents copying text to the clipboard. Is it possible to create an Entry that is not disabled, with the ability to copy text to clipboard, but at the same time make it read-only?

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

I think it is not possible to do this with the current API.

Describe the solution you'd like to see.

entry.SetReadOnly(true)
entry.SetReadOnly(false)
@andydotxyz
Copy link
Member

An entry that cannot be edited and cannot be copied? That is a Label isn't it?

@Jacalz
Copy link
Member

Jacalz commented Feb 15, 2025

It seems like this rather would be solved by making a selectable label like we talked about a while ago on the call

@nagylzs
Copy link
Author

nagylzs commented Feb 15, 2025

An entry that cannot be edited and cannot be copied? That is a Label isn't it?

An entry that cannot be edited and can be copied

@andydotxyz
Copy link
Member

My apologies, I misread your message.

It is possible to disable an Entry, but that prevents copying text to the clipboard.

This is not correct, and is where my confusion came from, a disabled entry can be copied.

@nagylzs
Copy link
Author

nagylzs commented Feb 15, 2025

This is not correct, and is where my confusion came from, a disabled entry can be copied.

My apologies, I was wrong. I was testing this under windows. In most Windows applications, a disabled entry cannot have the focus, and the text cannot be copied. (A native Windows read-only entry can have the focus, and its text can be copied, but it looks exactly like a non-disabled entry.) I was confused because I was expecting the native look and feel on Windows.

I can see now that some text can be selected with the mouse in a disabled fyne.Entry .

Here are some things that don't work:

  • Ctrl+A (select all)
  • Any kind of selection that requires the cursor in the entry, for example Ctrl+Shift+Right arrow would select the text from the cursor to the end of the next word, Ctrl+Shift+End would select the text from the cursor to the end of the text etc.

But they don't need to work, it was just a bit unexpected.

Thank you!

@nagylzs nagylzs closed this as completed Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants