Scroll to ref or anchor from Label

23 views
Skip to first unread message

Shivkumar Shivaji

unread,
Feb 15, 2016, 7:02:03 PM2/15/16
to Kivy users support
If one has a label with many refs, how does one scroll to a ref. I am looking for the equivalent of http://doc.qt.io/qt-4.8/qtextedit.html#scrollToAnchor

If you have many refs on a label and want to scroll to a ref without using the mouse, how can we do so programatically instead of using the mouse, which is useful in case of keyboard operation or button click.

I have a chess app written in kivy at https://github.com/sshivaji/kivy-chess that is in need of this functionality for the widget on the top right, thanks in advance.

Shivkumar Shivaji

unread,
Feb 15, 2016, 7:47:14 PM2/15/16
to Kivy users support
I found a way to make it work - (https://github.com/sshivaji/kivy-chess/commit/d2c5bb021fcad0606e863816fb9af94cba1be2ed)

 self.scroll_y= 1- (ref[1] location)*1.0/self.label.height from within a scroll view. Perhaps there is a better solution?
Reply all
Reply to author
Forward
0 new messages