Dominic LoBue wrote:
> Rereading your email I had another idea and made one more change which
> made the cause obvious: the screenshot
> http://upload.jkvl.com//files/2/voila_the_problem_revealed.jpg
> tells the story.
> 
> So does this mean my only choice is to switch over to the developmental 
> version?

No, you could write a custom widget based on WidgetWrap that switches 
its display_widget based on the focus parameter to render().

You would have to maintain two versions of the Columns and AttrWrap 
widgets, but you could share the Text widgets between both versions so 
you don't have to update the text in both places.

so, something like:

class MessageIndexEntry(urwid.WidgetWrap):
     def __init__(self, message):
         self.date_widget = urwid.Text(unicode(message.date))
         self.subject_widget = urwid.Text(unicode(message.subject))
         #...
         self.display_widget_focused = urwid.Columns([
             urwid.AttrWrap(self.date_widget #...
         self.display_widget_unfocused = urwid.Columns([
             urwid.AttrWrap(self.date_widget #...
         self.__super.__init__(self, self.display_widget_unfocused)

     def render(self, size, focus=False):
         self.display_widget = [self.display_widget_unfocused,
             self.display_widget_focused][focus]
         self.__super.render(self, size, focus)


_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to