-
Is there any way to set it? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
It seems we just can find what change in textedit or lineedit maybe you need this callback in TextInput(define textedit yourself): cursor-position-changed(Point): The cursor was moved to the new (x, y) position described by the Point argument. |
Beta Was this translation helpful? Give feedback.
-
you may find some help in api doc https://releases.slint.dev/1.5.1/docs/rust/slint/struct.sharedstring
获取Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Max Enko ***@***.***>
Sent: Thursday, April 25, 2024 7:21:55 AM
To: slint-ui/slint ***@***.***>
Cc: ***@***.*** ***@***.***>; Comment ***@***.***>
Subject: Re: [slint-ui/slint] Is there a way to find out where the caret index is in TextEdit or LineEdit? (Discussion #5123)
what i really need is caret index, i'll take it from there.
I already do this in WPF, its mundane.
―
Reply to this email directly, view it on GitHub<#5123 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AV7FXN7T6RTZ47SKUYNJHYTY7A5BHAVCNFSM6AAAAABGWKDNIOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TEMJYHE2DO>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Ok found it. This is not documented unless you dig through the source (or pay more attention to intellisense, as I should have). TextInput has: TextInput {
text: "Hello World";
cursor-position-changed(p) => {
debug(self.cursor-position-byte-offset);
}
} |
Beta Was this translation helpful? Give feedback.
Ok found it. This is not documented unless you dig through the source (or pay more attention to intellisense, as I should have).
TextInput has:
self.cursor-position-byte-offset
self.anchor-position-byte-offset