Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Can I get the position of scrollbar in ui module?
-
@JonB But I can't get the position of the scrollbar.
-
@lpl, if I understand correctly, this is a markedly different approach where you do not worry about details like scroll position, but instead focus on creating a custom ListDataSource that will be dynamically polled whenever a new list item is needed.
-
@mikael I need to know the location to pre-load the next page of a book from the website. If a user almost finishes this page, I will pre-load the next one.
-
@lpl, look at TableView.data_source and the tableview_cell_for_row method. @JonB, is it the case that this is only called when needed?
-
@mikael yes, I think so. I have a TableView with 10000 rows and cell_for_row is only called for displayed rows, hopefully 😀
-
Yup, only called when needed. You can also create tableview cells offline, and serve them up in tableview_cell_for_row. For instance, you could prefetch next page.
Of course, this sounds now like a webview might be more suited, if the book is HTML
-
I made it. By using label and scrollview, I just need about 15 labels to display a lot of words. And when I almost read the page(by using the postion of the scrollbar), I pre-load the next one and change the content_size of the scrollbar. Just pure python.
-
@lpl, nice. Care to share, for example as a gist?
-
@mikael Still working on other feathers. But I will share all the codes on my github in the future.
-
@mikael Done. But the reader has some 18+ sites. Be careful. https://github.com/yjqiang/yj_ebook_reader Execute eimg_reader.py or ebook_reader.py.