comparison frontends/primitivus/custom_widgets.py @ 172:726786e914c3

Primitivus: buttons are now in the bottom of Dialogs
author Goffi <goffi@goffi.org>
date Thu, 12 Aug 2010 13:18:11 +0800
parents 6fd053c99421
children a50953ac6191
comparison
equal deleted inserted replaced
171:96af1bec2e68 172:726786e914c3
659 urwid.Button(_("No"), kwargs['no_cb'], kwargs['yes_value'])] 659 urwid.Button(_("No"), kwargs['no_cb'], kwargs['yes_value'])]
660 if "OK" in style: 660 if "OK" in style:
661 buttons = [urwid.Button(_("Ok"), kwargs['ok_cb'], kwargs['ok_value'])] 661 buttons = [urwid.Button(_("Ok"), kwargs['ok_cb'], kwargs['ok_value'])]
662 if buttons: 662 if buttons:
663 buttons_flow = urwid.GridFlow(buttons, max([len(button.get_label()) for button in buttons])+4, 1, 1, 'center') 663 buttons_flow = urwid.GridFlow(buttons, max([len(button.get_label()) for button in buttons])+4, 1, 1, 'center')
664 widgets_lst.append(buttons_flow)
665 body_content = urwid.SimpleListWalker(widgets_lst) 664 body_content = urwid.SimpleListWalker(widgets_lst)
666 frame_body = urwid.ListBox(body_content) 665 frame_body = urwid.ListBox(body_content)
667 frame = urwid.Frame(frame_body, frame_header) 666 frame = urwid.Frame(frame_body, frame_header, buttons_flow if buttons else None)
668 decorated_frame = urwid.LineBox(frame) 667 decorated_frame = urwid.LineBox(frame)
669 urwid.WidgetWrap.__init__(self, decorated_frame) 668 urwid.WidgetWrap.__init__(self, decorated_frame)
670 669
671 670
672 671