On Thu, May 24, 2012 at 2:29 PM, Eric Easley <[email protected]> wrote: > To Whom It May Concern: > > If a GridFlow is larger than the screen, it can be scrolled through. However, > if > GridFlow X loses focus, by switching focus to another widget in a pile or > column > for example, GridFlow X shows only the first cells of the GridFlow rather than > those around the former focus cell. A minimal example can be found at > http://pastebin.com/6X0vNMAq . Run the script, scroll down so that Button 0 is > no longer showing and hit 'tab'. Focus will switch to the second GridFlow, but > the first GridFlow now show button 0 again as though it had never scrolled. > > I would expect the GridFlow to retain its 'position' even without focus, like > ListBox does. Is this a strange expectation or is GridFlow's behavior strange? > To change this behavior, would GridFlow require calculate_visible() like > ListBox? Thank you.
Thanks Eric! In this case it's actually the Filler that is choosing the position of the GridFlow, so that would be the place to add logic about remembering position. GridFlow is a flow widget and doesn't know if part of itself is obscured. Filler will trim a large flow widget it contains and has to decide how much to trim from the top and bottom. When the GridFlow is rendering a cursor then that cursor position overrides the Filler's preference by ensuring the cursor is visible. When not in focus (and not displaying a cursor) the Filler will revert to its normal behaviour. Maybe just putting your GridFlow as a single item in a ListBox will work? Ian _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
