Ian, Urwid is not behaving as I expected with the collapsible widgets I created for reading email conversations. In short, when a widget is expanded or made more "detailed" (which makes one widget go from one line to multi-line), the enlarged widget (or series or widgets, as they case may be), displaces the widgets above it. Focus doesn't move, nor does the widget in focus move at all, but I had expected the below widgets to be displaced instead.
The best example I can give you is the header widget. The header widget has two modes: summary and detailed. In summary mode the widget says something along the lines of "Sent <date> from <sender>". In detailed mode the widget is 5 lines, one line each for From, To, Cc, Sent, Subject. Each individual message in a conversation is made up of several widgets. From any of these widgets when you press the appropriate key, you can expand the header widget. Getting to the point, I open a conversation, move the focus down to the body of the message, and toggle the header detail widget. When the header widget is toggled to detailed, the widget expands upwards offscreen and all that is visible is the last line. I think I can use the listbox shift_focus() method to yank everything down, but I'm not sure to go about doing it. More details and examples on both the shift_focus and change_focus methods would be greatly appreciated. Ideally a method where you specify the index of the topmost widget you want displayed, and focus is automatically shifted or dragged along (if the specified index would put the originally selected index off-screen) to compensate would be _perfect_. If you know of a better way to do this though, I'm all ears. Also, a suggestion: with the addition of the event loops in 0.9.9, instead of having to pass the (maxcol, maxrow), to each and every widget, why don't you store it in an attribute for big widgets, and only update or recalculate them when the terminal is resized? You could have the event loop send out a global "resized" signal with the new (maxcol, maxrow) so terminal resizings are handled properly. Dominic _______________________________________________ Urwid mailing list [email protected] http://lists.excess.org/mailman/listinfo/urwid
