Skip to content

Get selected text from TextInput #514

Description

@antwin

I need to find one of several urls in a TextInput (say with a double-click) so I can open it in a browser.
I've tried

self.recTxt = gui.TextInput(single_line=False, margin='10px')
self.recTxt.ondblclick.connect(self.onDblClick)
self.recTxt.onmousemove.connect(self.onMouseMove)

def onDblClick(self,obj):
    print(obj.children['text'])

I can get all the text, but not find the particular url that was clicked on.
Or I can get the mouse position in x,y coordinates.

How do I get the text?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions