Skip to content

Get selected text from Label #4913

Answered by YgorSouza
eleanor-em asked this question in Q&A
Discussion options

You must be logged in to vote

As rustbasic said, the selected text is already copied to the clipboard when a Copy event is received. I don't think it is possible to copy or access the selected text under different circumstances. The text to be copied is stored in this private field:

/// Accumulated text to copy.
text_to_copy: String,

This field is normally empty, as it is not needed on every frame. When a copy event arrives, every label appends its selected text to the accumulated selection as it is painted:

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@eleanor-em
Comment options

Comment options

You must be logged in to vote
1 reply
@eleanor-em
Comment options

Answer selected by eleanor-em
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants