Cool, thanks ian, I've done a little bit of both of the methods u described (position in footer, showing there are more entries on a following screen...) using piles and solidfill (similar to linebox in a way).
Let me look into the ends_visible(), wasn't aware of that one. If u avoid the determining the number of rows in the list box (the visual number of rows) but instead just attach the scrollbar to the current focus item index in the listbox then wouldn't this be easier? For an item which has focus at index 5 of a listbox of length 10 then u know u are 50%, even though this isn't (may not be) a direct connection to the visual number of rows (depending on what is contained in the list box) it would be a connection to being 50% through the listbox. Seems like there could be multiple implementations of a scrollbar, one implementation could be via this method, another one can be the more expensive visual number of rows and another could just be an infinite scrollbar (think similar to how websites dynamically add content to a webpage, and the scrollbar has to adjust for this). Anyways, merry xmas :-P On Tue, Dec 24, 2013 at 4:14 PM, Ian Ward <[email protected]> wrote: > Thanks Joshua, > > It's pretty easy to make a scroll bar to handle a specific use case. > You can make a 1-column wide Pile that uses SolidFill for the bar and > background regions. > > It's quite a bit harder to make one for the general case. ListBox > supports unlimited contents, so you would have to limit the list > walkers you can use. Next you have to decide if the position within a > list is sufficient or if you need to know the number of actual rows of > each item. For some lists the bar would perform badly without the > exact number of rows. If you need the exact rows then that means you > need to calculate the width of every item in the list, which for long > lists is going to be quite slow, and would need to be re-done every > time the width of the ListBox changes. > > Have you considered just having markers that indicates whether you can > scroll up and/or down? There's an ends_visible() method on ListBox > just for this purpose. > > Another approach is to show your position within the list in a footer, > the way less or vim do. > > Ian > > On Sun, Dec 15, 2013 at 10:24 PM, Joshua Harlow <[email protected]> > wrote: > > Hi all urwid devs, > > > > Thanks for the great library! > > > > It has allowed me to create a few useful tools @ > > https://github.com/harlowja/gerrit_view/ > > > > One feature that I am lacking though is a vertical scrollbar (it would be > > nice to know the current scroll status of a listbox for example, in said > > GUIs at the above github site). I have seen that there are/were a few > > attempts at it (but none seem to be in the offical repo). Has there been > any > > progress there, maybe a release with hbar and vbar support?? > > > > Thoughts?? > > > > -Josh > > > > -- > > -- > > facebook.com/jshharlow > > flickr.com/jshharlow > > YIM: jshharlow > > > > _______________________________________________ > > Urwid mailing list > > [email protected] > > http://lists.excess.org/mailman/listinfo/urwid > > > > _______________________________________________ > Urwid mailing list > [email protected] > http://lists.excess.org/mailman/listinfo/urwid > -- -- facebook.com/jshharlow <http://www.facebook.com/jshharlow> flickr.com/jshharlow YIM: jshharlow
_______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
